From fe5704d40398e29c05087e282df3cfd7dc0402e4 Mon Sep 17 00:00:00 2001 From: Simon Long Date: Mon, 29 Apr 2024 07:52:04 +0100 Subject: [PATCH] Only store key state on press --- src/input/keyboard.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/input/keyboard.c b/src/input/keyboard.c index e43d2655..11fe0181 100644 --- a/src/input/keyboard.c +++ b/src/input/keyboard.c @@ -415,7 +415,6 @@ handle_compositor_keybindings(struct keyboard *keyboard, cur_keybind = NULL; return false; } - key_state_store_pressed_key_as_bound(event->keycode); actions_run(NULL, server, &cur_keybind->actions, 0); cur_keybind = NULL; return true; @@ -459,15 +458,17 @@ handle_compositor_keybindings(struct keyboard *keyboard, */ cur_keybind = match_keybinding(server, &keyinfo, keyboard->is_virtual); - if (cur_keybind && !cur_keybind->mod_only) { + if (cur_keybind) { /* * Update key-state before action_run() because the action * might lead to seat_focus() in which case we pass the * 'pressed-sent' keys to the new surface. */ key_state_store_pressed_key_as_bound(event->keycode); - actions_run(NULL, server, &cur_keybind->actions, 0); - cur_keybind = NULL; + if (!cur_keybind->mod_only) { + actions_run(NULL, server, &cur_keybind->actions, 0); + cur_keybind = NULL; + } return true; }