aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/input/keyboard.h
diff options
context:
space:
mode:
authorLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-08-15 00:59:39 -0400
committerLibravatar Drew DeVault <sir@cmpwn.com>2019-08-27 09:37:10 +0900
commit091b87bfb89726bc13b4763d4f730f7d17cfc575 (patch)
treeabe31357795cf803bd0797963520319fb4ace144 /include/sway/input/keyboard.h
parentlayer-shell: add support for popups (diff)
downloadsway-091b87bfb89726bc13b4763d4f730f7d17cfc575.tar.gz
sway-091b87bfb89726bc13b4763d4f730f7d17cfc575.tar.zst
sway-091b87bfb89726bc13b4763d4f730f7d17cfc575.zip
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.
Diffstat (limited to 'include/sway/input/keyboard.h')
-rw-r--r--include/sway/input/keyboard.h1
1 files changed, 1 insertions, 0 deletions
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 {
60 struct sway_shortcut_state state_keysyms_translated; 60 struct sway_shortcut_state state_keysyms_translated;
61 struct sway_shortcut_state state_keysyms_raw; 61 struct sway_shortcut_state state_keysyms_raw;
62 struct sway_shortcut_state state_keycodes; 62 struct sway_shortcut_state state_keycodes;
63 struct sway_shortcut_state state_pressed_sent;
63 struct sway_binding *held_binding; 64 struct sway_binding *held_binding;
64 65
65 struct wl_event_source *key_repeat_source; 66 struct wl_event_source *key_repeat_source;