From 8c17b670fb61d2fbfaaf8f47448d0e48bfa7f29e Mon Sep 17 00:00:00 2001 From: Alban Crequy Date: Mon, 5 Aug 2013 16:00:32 +0100 Subject: [PATCH] keybindings: always acknowledge events to the X server https://bugzilla.gnome.org/show_bug.cgi?id=666101 --- src/core/keybindings.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index 8439ea830..7f58334f8 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -1965,6 +1965,23 @@ process_overlay_key (MetaDisplay *display, return TRUE; meta_display_overlay_key_activate (display); } + else + { + /* In some rare race condition, mutter might not receive the Super_L + * KeyRelease event because: + * - the compositor might end the modal mode and call XIUngrabDevice + * while the key is still down + * - passive grabs are only activated on KeyPress and not KeyRelease. + * + * In this case, display->overlay_key_only_pressed might be wrong. + * Mutter still ought to acknowledge events, otherwise the X server + * will not send the next events. + * + * https://bugzilla.gnome.org/show_bug.cgi?id=666101 + */ + XIAllowEvents (display->xdisplay, event->deviceid, + XIAsyncDevice, event->time); + } return TRUE; }