rem: if (XGrabPointer(dpy, wwin->frame->titlebar->window, False,
context: titlebarMouseDown(WCoreWindow *sender, void *data, XEvent *event){    WWindow *wwin = (WWindow*)data;#ifndef NUMLOCK_HACK    if ((event->xbutton.state & ValidModMask)	!= (event->xbutton.state & ~LockMask)) {	wwarning(_("the NumLock, ScrollLock or similar key seems to be turned on.\n"\		"Turn it off or some mouse actions and keyboard shortcuts will not work."));    }#endif        event->xbutton.state &= ValidModMask;        CloseWindowMenu(wwin->screen_ptr);        if (wPreferences.focus_mode==WKF_CLICK 	&& !(event->xbutton.state&ControlMask)) {	wSetFocusTo(wwin->screen_ptr, wwin);    }        if (event->xbutton.button == Button1	|| event->xbutton.button == Button2) {		if (event->xbutton.button == Button1) {	    if (event->xbutton.state & MOD_MASK) {		wLowerFrame(wwin->frame->core);	    } else {		wRaiseFrame(wwin->frame->core);	    }	}	if ((event->xbutton.state & ShiftMask)	    && !(event->xbutton.state & ControlMask)) {	    wSelectWindow(wwin);	    return;	}	if (XGrabPointer(dpy, wwin->frame->titlebar->window, False, 			 ButtonMotionMask|ButtonReleaseMask|ButtonPressMask,			 GrabModeAsync, GrabModeAsync, None, 			 None, CurrentTime)!=GrabSuccess) {#ifdef DEBUG0	    wwarning("pointer grab failed for window move");#endif	    return;	}	/* move the window */	wMouseMoveWindow(wwin, event);	XUngrabPointer(dpy, CurrentTime);    } else if (event->xbutton.button == Button3 && event->xbutton.state==0	       && !wwin->flags.internal_window) {	WObjDescriptor *desc;		OpenWindowMenu(wwin, event->xbutton.x_root, 		       wwin->frame_y+wwin->frame->top_width, False);	/* allow drag select */	desc = &wwin->screen_ptr->window_menu->menu->descriptor;	event->xany.send_event = True;	(*desc->handle_mousedown)(desc, event);    }}