]> git.sur5r.net Git - i3/i3/commitdiff
Don't trigger binding on window border click unless --border is given. (#2349)
authorIngo Bürk <admin@airblader.de>
Wed, 11 May 2016 18:11:35 +0000 (20:11 +0200)
committerMichael Stapelberg <stapelberg@users.noreply.github.com>
Wed, 11 May 2016 18:11:35 +0000 (20:11 +0200)
Prior to this commit a binding specifying only --whole-window would
trigger even when clicking on the window border. However, this should
only happen if --border is specified.

fixes #2348

src/click.c

index a670120f110f73ed3a0724c4c60fa31ffae642b7..788c10f2253ed6605d735010cbfda77084640ebe 100644 (file)
@@ -187,11 +187,10 @@ static int route_click(Con *con, xcb_button_press_event_t *event, const bool mod
      * default behavior. */
     if (dest == CLICK_DECORATION || dest == CLICK_INSIDE || dest == CLICK_BORDER) {
         Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
-        /* clicks over a window decoration will always trigger the binding and
-         * clicks on the inside of the window will only trigger a binding if
-         * the --whole-window flag was given for the binding. */
-        if (bind && ((dest == CLICK_DECORATION || bind->whole_window) ||
-                     (dest == CLICK_BORDER && bind->border))) {
+
+        if (bind != NULL && (dest == CLICK_DECORATION ||
+                             (dest == CLICK_INSIDE && bind->whole_window) ||
+                             (dest == CLICK_BORDER && bind->border))) {
             CommandResult *result = run_binding(bind, con);
 
             /* ASYNC_POINTER eats the event */