Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
route_click: Remove condition that is always true
Browse files Browse the repository at this point in the history
For reference:
typedef enum { CLICK_BORDER = 0,
               CLICK_DECORATION = 1,
               CLICK_INSIDE = 2 } click_destination_t;
  • Loading branch information
orestisfl committed Apr 10, 2020
1 parent 07c7384 commit 58d383b
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/click.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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);
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);

/* 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. */
Expand Down

0 comments on commit 58d383b

Please sign in to comment.