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

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