[gtk/fix-inspector-key] x11: Fix key event state translation



commit abeabc39e8110b84d6f97456ed09271138066a34
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 21 10:25:06 2020 -0400

    x11: Fix key event state translation
    
    In the event refactoring, a bit was lost.
    
    This makes Ctrl-Shift-i work again to open
    the inspector.

 gdk/x11/gdkdevicemanager-xi2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 26adf00313..6e6ba54c93 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1520,7 +1520,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
       {
         XIDeviceEvent *xev = (XIDeviceEvent *) ev;
         GdkKeymap *keymap = gdk_display_get_keymap (display);
-        GdkModifierType consumed, state;
+        GdkModifierType consumed, state, orig_state;
         guint keyval;
 
         GDK_DISPLAY_NOTE (display, EVENTS,
@@ -1550,9 +1550,10 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
                                              xev->group.effective,
                                              &keyval,
                                              NULL, NULL, &consumed);
-
+        orig_state = state;
         state &= ~consumed;
         _gdk_x11_keymap_add_virt_mods (keymap, &state);
+        state |= orig_state;
 
         event = gdk_event_key_new (xev->evtype == XI_KeyPress
                                      ? GDK_KEY_PRESS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]