route_click: Remove condition that is always true

For reference:
typedef enum { CLICK_BORDER = 0,
               CLICK_DECORATION = 1,
               CLICK_INSIDE = 2 } click_destination_t;
This commit is contained in:
Orestis Floros 2020-04-10 12:24:18 +02:00
parent 07c7384272
commit 58d383b1a0
No known key found for this signature in database
GPG Key ID: A09DBD7D3222C1C3
1 changed files with 10 additions and 13 deletions

View File

@ -162,21 +162,18 @@ static void route_click(Con *con, xcb_button_press_event_t *event, const bool mo
/* if the user has bound an action to this click, it should override the
* default behavior. */
if (dest == CLICK_DECORATION || dest == CLICK_INSIDE || dest == CLICK_BORDER) {
Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
if (bind && ((dest == CLICK_DECORATION && !bind->exclude_titlebar) ||
(dest == CLICK_INSIDE && bind->whole_window) ||
(dest == CLICK_BORDER && bind->border))) {
CommandResult *result = run_binding(bind, con);
if (bind != NULL && ((dest == CLICK_DECORATION && !bind->exclude_titlebar) ||
(dest == CLICK_INSIDE && bind->whole_window) ||
(dest == CLICK_BORDER && bind->border))) {
CommandResult *result = run_binding(bind, con);
/* ASYNC_POINTER eats the event */
xcb_allow_events(conn, XCB_ALLOW_ASYNC_POINTER, event->time);
xcb_flush(conn);
/* ASYNC_POINTER eats the event */
xcb_allow_events(conn, XCB_ALLOW_ASYNC_POINTER, event->time);
xcb_flush(conn);
command_result_free(result);
return;
}
command_result_free(result);
return;
}
/* There is no default behavior for button release events so we are done. */