Blob Blame History Raw
--- vino-2.12.0/ChangeLog.fix-broken-level3-shift	2005-09-06 05:20:42.000000000 -0400
+++ vino-2.12.0/ChangeLog	2005-09-26 12:46:18.000000000 -0400
@@ -0,0 +1,9 @@
+2005-09-26  Mark McLoughlin  <mark@skynet.ie>
+
+	Based on patch from  Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+	Fixes keyboard brokeness with some X server configurations.
+
+	* server/vino-input.c: (vino_input_handle_key_event): don't
+	send press/release pairs for each XK_Mode_switch and XK_ISO_Level3_Shift
+	keypress.
+
--- vino-2.12.0/server/vino-input.c.fix-broken-level3-shift	2005-05-27 06:54:58.000000000 -0400
+++ vino-2.12.0/server/vino-input.c	2005-09-26 12:46:18.000000000 -0400
@@ -49,6 +49,10 @@
  */
 #define VINO_IS_LATIN1_KEYSYM(k) ((k) != NoSymbol && ((k) & 0x0f00) == 0)
 
+#define VINO_IS_MODIFIER_KEYSYM(k) (((k) >= XK_Shift_L && (k) <= XK_Hyper_R) || \
+                                     (k) == XK_Mode_switch                   || \
+                                     (k) == XK_ISO_Level3_Shift)
+
 typedef enum
 {
   VINO_LEFT_SHIFT  = 1 << 0,
@@ -300,7 +304,7 @@
    * and ignore key releases. The exception is modifiers.
    */
 
-  if (!key_press && !(keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
+  if (!key_press && !VINO_IS_MODIFIER_KEYSYM (keysym))
     return;
 
   xdisplay = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
@@ -348,7 +352,7 @@
 
 	  XTestFakeKeyEvent (xdisplay, keycode, key_press, CurrentTime);
 
-	  if (key_press && !(keysym >= XK_Shift_L && keysym <= XK_Hyper_R))
+	  if (key_press && !VINO_IS_MODIFIER_KEYSYM (keysym))
 	    {
 	      XTestFakeKeyEvent (xdisplay, keycode, FALSE, CurrentTime);
 	    }