From 384afc5cb5000374414eeaec8cbb667451fcce5b Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Thu, 15 Aug 2019 00:59:39 -0400 Subject: input/keyboard: send released only if pressed sent This keeps track of whether surfaces received a key press event and will only send a key release event if the pressed event was sent. This also requires changing the keycodes that are sent via wl_keyboard_enter to only include those that were previously sent. This makes it so surfaces do not receive key release events for keys that they never received a key press for and makes it so switching focus doesn't leak keycodes that were consumed by bindings. --- include/sway/input/keyboard.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/sway/input/keyboard.h') diff --git a/include/sway/input/keyboard.h b/include/sway/input/keyboard.h index 1ff63c94..4aa0d8f4 100644 --- a/include/sway/input/keyboard.h +++ b/include/sway/input/keyboard.h @@ -60,6 +60,7 @@ struct sway_keyboard { struct sway_shortcut_state state_keysyms_translated; struct sway_shortcut_state state_keysyms_raw; struct sway_shortcut_state state_keycodes; + struct sway_shortcut_state state_pressed_sent; struct sway_binding *held_binding; struct wl_event_source *key_repeat_source; -- cgit v1.2.3-54-g00ecf