X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fclick.c;h=51ffcf3ab3c4361452897713bf399bdf70c87302;hb=c815fc798d530aaaac1ab3402ccd47defb7bcc0f;hp=86a63ea68ce4cce090bb45f636e52b94d0098a2f;hpb=dd5be77d1dcc7e7eb40ce1c33f985816fc0b8f79;p=i3%2Fi3 diff --git a/src/click.c b/src/click.c index 86a63ea6..51ffcf3a 100644 --- a/src/click.c +++ b/src/click.c @@ -200,6 +200,11 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod } } + /* There is no default behavior for button release events so we are done. */ + if (event->response_type == XCB_BUTTON_RELEASE) { + goto done; + } + /* Any click in a workspace should focus that workspace. If the * workspace is on another output we need to do a workspace_show in * order for i3bar (and others) to notice the change in workspace. */ @@ -336,9 +341,10 @@ done: */ int handle_button_press(xcb_button_press_event_t *event) { Con *con; - DLOG("Button %d pressed on window 0x%08x (child 0x%08x) at (%d, %d) (root %d, %d)\n", - event->state, event->event, event->child, event->event_x, event->event_y, - event->root_x, event->root_y); + DLOG("Button %d %s on window 0x%08x (child 0x%08x) at (%d, %d) (root %d, %d)\n", + event->state, (event->response_type == XCB_BUTTON_PRESS ? "press" : "release"), + event->event, event->child, event->event_x, event->event_y, event->root_x, + event->root_y); last_timestamp = event->time; @@ -351,7 +357,7 @@ int handle_button_press(xcb_button_press_event_t *event) { if (!(con = con_by_frame_id(event->event))) { /* If the root window is clicked, find the relevant output from the * click coordinates and focus the output's active workspace. */ - if (event->event == root) { + if (event->event == root && event->response_type == XCB_BUTTON_PRESS) { Con *output, *ws; TAILQ_FOREACH(output, &(croot->nodes_head), nodes) { if (con_is_internal(output) ||