static void finish_contextual_menus() { if(wglobal.input_mode==INPUT_CTXMENU) ungrab_kb_ptr(); destroy_contextual_menus(); }
void default_pointer_handler(XEvent *ev) { XEvent tmp; Window win_pressed; WThing *t; bool mouse_grab_held=FALSE; if(grab_held()) return; win_pressed=ev->xbutton.window; if(!handle_button_press(&ev->xbutton)) return; mouse_grab_held=TRUE; while(mouse_grab_held){ XFlush(wglobal.dpy); get_event_mask(ev, GRAB_EV_MASK); switch(ev->type){ CASE_EVENT(ButtonRelease) if(handle_button_release(&(ev->xbutton))){ ungrab_kb_ptr(); mouse_grab_held=FALSE; } break; CASE_EVENT(MotionNotify) handle_pointer_motion(&(ev->xmotion)); break; CASE_EVENT(Expose) handle_expose(&(ev->xexpose)); break; } } }