From bfabcc181f03dca678e075891341da887e55d178 Mon Sep 17 00:00:00 2001 From: Brian Ashworth Date: Sun, 29 Dec 2019 17:16:19 -0500 Subject: [PATCH] input/keyboard: handle event->group_update When a keyboard is added to or removed from a wlr_keyboard_group, a key event will be emitted for all keys that only pressed for that keyboard in the group. This allows for compositors to update their internal state. However because these keys were already down, bindings should not be executed and surfaces should not receive a key event. --- sway/input/keyboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 2cfcd1265..08fb33dab 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -359,6 +359,12 @@ static void handle_key_event(struct sway_keyboard *keyboard, code_modifiers); } + // A keyboard was added to/removed from the group, just update the status + if (event->group_update) { + assert(wlr_keyboard_group_from_wlr_keyboard(wlr_device->keyboard)); + return; + } + bool handled = false; // Identify active release binding struct sway_binding *binding_released = NULL;