Comment 36 for bug 270997

Revision history for this message
David Imhoff (dimhoff) wrote :

The 02_raw_keyboard_support patch seems to be grabbing the keyboard even if the g_grab_keyboard variable is not set. The patch below should fix the patch.

--- /tmp/02_raw_keyboard_support.dpatch 2010-07-19 13:23:14.000000000 +0200
+++ 02_raw_keyboard_support.dpatch 2010-07-19 13:23:31.000000000 +0200
@@ -312,7 +312,7 @@
 +
 + // Mode_switch during XGrabKeyboard fix: Ungrab Keyboard during Mode_switch
 + if ( keysym == XK_Mode_switch ) g_modeswitch_down = True;
-+ if ( g_focused && g_modeswitch_down ) XUngrabKeyboard(g_display, CurrentTime);
++ if ( g_focused && g_grab_keyboard && g_modeswitch_down ) XUngrabKeyboard(g_display, CurrentTime);
 +
                                DEBUG_KBD(("KeyPress for keysym (0x%lx, %s)\n", keysym,
                                           get_ksname(keysym)));
@@ -324,7 +324,7 @@
 +
 + // Mode_switch during XGrabKeyboard fix: Regrab Keyboard after Mode_switch
 + if ( keysym == XK_Mode_switch ) g_modeswitch_down = False;
-+ if ( g_focused && !g_modeswitch_down ) XGrabKeyboard(g_display, g_wnd, True, GrabModeAsync, GrabModeAsync, CurrentTime);
++ if ( g_focused && g_grab_keyboard && !g_modeswitch_down ) XGrabKeyboard(g_display, g_wnd, True, GrabModeAsync, GrabModeAsync, CurrentTime);
 +
                                DEBUG_KBD(("\nKeyRelease for keysym (0x%lx, %s)\n", keysym,
                                           get_ksname(keysym)));