[gtk+/gtk-2-18] Make level3 keys work again



commit b796473068ee07515b9d3140bfc5a54007b01b4c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Nov 25 01:02:40 2009 -0500

    Make level3 keys work again
    
    We were not paying attention to consumed modifiers when adding
    virtual modifiers. This fixes RH bug 537567.

 gdk/x11/gdkevents-x11.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c
index e2cae06..c62fb0b 100644
--- a/gdk/x11/gdkevents-x11.c
+++ b/gdk/x11/gdkevents-x11.c
@@ -618,6 +618,7 @@ translate_key_event (GdkDisplay *display,
   GdkKeymap *keymap = gdk_keymap_get_for_display (display);
   gunichar c = 0;
   gchar buf[7];
+  GdkModifierType consumed, state;
 
   event->key.type = xevent->xany.type == KeyPress ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
   event->key.time = xevent->xkey.time;
@@ -633,9 +634,11 @@ translate_key_event (GdkDisplay *display,
 				       event->key.state,
 				       event->key.group,
 				       &event->key.keyval,
-				       NULL, NULL, NULL);
+                                       NULL, NULL, &consumed);
+   state = event->key.state & ~consumed;
+   _gdk_keymap_add_virtual_modifiers (keymap, &state);
+   event->key.state |= state;
 
-  _gdk_keymap_add_virtual_modifiers (keymap, &event->key.state);
   event->key.is_modifier = _gdk_keymap_key_is_modifier (keymap, event->key.hardware_keycode);
 
   /* Fill in event->string crudely, since various programs



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