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

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