void mouse_handle_event(XEvent* ev) { XButtonEvent* be = &(ev->xbutton); MouseBinding* b = mouse_binding_find(be->state, be->button); HSClient* client = get_client_from_window(ev->xbutton.window); if (!b || !client) { // there is no valid bind for this type of mouse event return; } b->action(client, b->argc, b->argv); }
void buttonpress(XEvent* event) { XButtonEvent* be = &(event->xbutton); HSDebug("name is: ButtonPress on sub %lx, win %lx\n", be->subwindow, be->window); if (mouse_binding_find(be->state, be->button)) { mouse_start_drag(event); } else { focus_window(be->window, false, true); if (*g_raise_on_click) { HSClient* client = get_client_from_window(be->window); if (client) { client_raise(client); } } } XAllowEvents(g_display, ReplayPointer, be->time); }