kathenas / rpms / mutter

Forked from rpms/mutter 5 years ago
Clone

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

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