]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Fix release keybindings being triggered after mouse bindings
authorSimon Long <simon@raspberrypi.com>
Thu, 13 Jun 2024 09:57:34 +0000 (10:57 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Sat, 15 Jun 2024 20:22:58 +0000 (21:22 +0100)
src/action.c
src/input/keyboard.c

index 6f6bee946c6796fb8a38b0052669f282d3dbf168..f8ce2f8270681256e468c4c15de0dca621cf19a4 100644 (file)
@@ -177,6 +177,8 @@ const char *action_names[] = {
        NULL
 };
 
+extern struct keybind *cur_keybind;
+
 void
 action_arg_add_str(struct action *action, const char *key, const char *value)
 {
@@ -707,6 +709,8 @@ actions_run(struct view *activator, struct server *server,
                return;
        }
 
+       cur_keybind = NULL;
+
        struct view *view;
        struct action *action;
        wl_list_for_each(action, actions, link) {
index bbadce220fda3ece651a352cf4d2c5d3366a64c0..d42650b3e8f2d204c796d1e5ce72eb4dcfaced63 100644 (file)
@@ -38,7 +38,7 @@ struct keyinfo {
 
 static bool should_cancel_cycling_on_next_key_release;
 
-static struct keybind *cur_keybind;
+struct keybind *cur_keybind;
 
 /* Called on --reconfigure to prevent segfault when handling release keybinds */
 void
@@ -438,7 +438,6 @@ handle_compositor_keybindings(struct keyboard *keyboard,
                                return true;
                        }
                        actions_run(NULL, server, &cur_keybind->actions, 0);
-                       cur_keybind = NULL;
                        return true;
                } else {
                        return handle_key_release(server, event->keycode);
@@ -488,8 +487,6 @@ handle_compositor_keybindings(struct keyboard *keyboard,
                key_state_store_pressed_key_as_bound(event->keycode);
                if (!cur_keybind->on_release) {
                        actions_run(NULL, server, &cur_keybind->actions, 0);
-                       /* This cancels any pending on-release keybinds */
-                       cur_keybind = NULL;
                }
                return true;
        }