summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-03-15 18:33:05 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-03-15 18:44:07 +0100
commitcb40049ec1e8a995a72d88500071785e228a417e (patch)
tree8e24745c67ccd6ff7bde50ed491a1771b4b30f47
parent481e87032c981cb939301ca72b4d6dc4c91711fb (diff)
downloadmutter-wip/carlosg/fix-issue-74.tar.gz
wayland: Ignore IM/synthetic key events when updating XKB statewip/carlosg/fix-issue-74
This state tracks hardware devices' state, thus shouldn't be triggered by events that were emulated/forwarded by the IM. Those may include modifiers and would result in xkb_state being doubly set, and possibly stuck. https://gitlab.gnome.org/GNOME/mutter/issues/74 Closes: #74
-rw-r--r--src/wayland/meta-wayland-keyboard.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-keyboard.c b/src/wayland/meta-wayland-keyboard.c
index ba77fcc39..211a127f3 100644
--- a/src/wayland/meta-wayland-keyboard.c
+++ b/src/wayland/meta-wayland-keyboard.c
@@ -767,6 +767,14 @@ meta_wayland_keyboard_update (MetaWaylandKeyboard *keyboard,
{
gboolean is_press = event->type == CLUTTER_KEY_PRESS;
+ /* Only handle real, non-synthetic, events here. The IM is free to reemit
+ * key events (incl. modifiers), handling those additionally will result
+ * in doubly-pressed keys.
+ */
+ if (event->flags &
+ (CLUTTER_EVENT_FLAG_SYNTHETIC | CLUTTER_EVENT_FLAG_INPUT_METHOD) != 0)
+ return;
+
/* 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