From e284370013013967a6483de9c067ad4fde4954f9 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Tue, 3 Nov 2015 17:58:16 +0100 Subject: [PATCH] wayland-keyboard: Notify clients of pending modifier state changes If we get a key event but still have pending modifier state changes we need to send a modifiers event right away so that the key event can be interpreted by clients correctly modified. This case could happen when mutter/gnome-shell itself consumes the modifier key press event such as with the overview key which by default is triggered on super press. https://bugzilla.gnome.org/show_bug.cgi?id=748526 --- src/wayland/meta-wayland-keyboard.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c index 177246029..003e483c2 100644 --- a/src/wayland/meta-wayland-keyboard.c +++ b/src/wayland/meta-wayland-keyboard.c @@ -555,6 +555,13 @@ meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard, { gboolean is_press = event->type == CLUTTER_KEY_PRESS; + /* If we get a key event but still have pending modifier state + * changes from a previous event that didn't get cleared, we need to + * send that state right away so that the new key event can be + * interpreted by clients correctly modified. */ + if (keyboard->mods_changed) + notify_modifiers (keyboard); + keyboard->mods_changed = xkb_state_update_key (keyboard->xkb_info.state, event->hardware_keycode, is_press ? XKB_KEY_DOWN : XKB_KEY_UP);