Blame SOURCES/0001-clutter-Do-not-latch-modifiers-on-modifier-keys.patch

a32ffd
From 67aab7c13812befde061f0d2068b431b04dcbc98 Mon Sep 17 00:00:00 2001
a32ffd
From: Carlos Garnacho <carlosg@gnome.org>
a32ffd
Date: Wed, 3 Oct 2018 22:43:21 +0200
a32ffd
Subject: [PATCH] clutter: Do not latch modifiers on modifier keys
a32ffd
a32ffd
If the user maps eg. Alt+F2 to a pad button, the MetaInputSettings will
a32ffd
send the full Alt press, F2 press, F2 release, Alt release sequence.
a32ffd
However the keycode corresponding to Alt is found in level 1, so the
a32ffd
Shift modifier gets unintendedly latched in addition to the Alt key
a32ffd
press/release pair.
a32ffd
a32ffd
We could probably improve keycode lookup heuristics so level=0 (and
a32ffd
no modifier latching) is preferred, but we can do without it altogether
a32ffd
for modifier keys.
a32ffd
---
a32ffd
 clutter/clutter/x11/clutter-virtual-input-device-x11.c | 6 ++++--
a32ffd
 1 file changed, 4 insertions(+), 2 deletions(-)
a32ffd
a32ffd
diff --git a/clutter/clutter/x11/clutter-virtual-input-device-x11.c b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
a32ffd
index b86ded0d0..e16ba3fd0 100644
a32ffd
--- a/clutter/clutter/x11/clutter-virtual-input-device-x11.c
a32ffd
+++ b/clutter/clutter/x11/clutter-virtual-input-device-x11.c
a32ffd
@@ -147,14 +147,16 @@ clutter_virtual_input_device_x11_notify_keyval (ClutterVirtualInputDevice *virtu
a32ffd
       return;
a32ffd
     }
a32ffd
 
a32ffd
-  if (key_state == CLUTTER_KEY_STATE_PRESSED)
a32ffd
+  if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
a32ffd
+      key_state == CLUTTER_KEY_STATE_PRESSED)
a32ffd
     clutter_keymap_x11_latch_modifiers (keymap, level, TRUE);
a32ffd
 
a32ffd
   XTestFakeKeyEvent (clutter_x11_get_default_display (),
a32ffd
                      (KeyCode) keycode,
a32ffd
                      key_state == CLUTTER_KEY_STATE_PRESSED, 0);
a32ffd
 
a32ffd
-  if (key_state == CLUTTER_KEY_STATE_RELEASED)
a32ffd
+  if (!_clutter_keymap_x11_get_is_modifier (keymap, keycode) &&
a32ffd
+      key_state == CLUTTER_KEY_STATE_RELEASED)
a32ffd
     clutter_keymap_x11_latch_modifiers (keymap, level, FALSE);
a32ffd
 }
a32ffd
 
a32ffd
-- 
a32ffd
2.19.0
a32ffd