예제 #1
0
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);
}
예제 #2
0
파일: main.c 프로젝트: xiaq/hlwm
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);
}