mirror of
https://github.com/swaywm/sway.git
synced 2025-10-29 05:40:18 -04:00
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.
This commit is contained in:
parent
7488d33d42
commit
384afc5cb5
3 changed files with 54 additions and 27 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue