[gtk+] XI2: translate group state back into core state



commit eaba2cd46852d5f331f22f4272afb5bcc6645870
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 4 21:08:41 2011 -0500

    XI2: translate group state back into core state
    
    This is necessary to make the key event translation work
    as expected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=641367

 gdk/x11/gdkdevice-xi2.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index a3700de..4b71810 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -728,5 +728,17 @@ _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
         }
     }
 
+  if (group_state)
+    {
+      gint group;
+
+      group = group_state->base + group_state->latched + group_state->locked;
+
+      /* FIXME: do we need the XKB complications for this ? */
+      group = CLAMP(group, 0, 3);
+
+      state |= group << 13;
+    }
+
   return state;
 }



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