Hopefully fixed focus problems when handling a global hotkey on X11.
authorSam Lantinga <slouken@libsdl.org>
Sun, 10 Nov 2013 14:33:01 -0800
changeset 7942 a1c4c17410e8
parent 7941 7c249ca44069
child 7943 713c6a333c33
Hopefully fixed focus problems when handling a global hotkey on X11. See this thread for details: https://bugzilla.mozilla.org/show_bug.cgi?id=578265
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Sun Nov 10 14:10:00 2013 -0800
+++ b/src/video/x11/SDL_x11events.c	Sun Nov 10 14:33:01 2013 -0800
@@ -408,6 +408,13 @@
 
         /* Losing input focus? */
     case FocusOut:{
+            if (xevent.xfocus.mode == NotifyGrab) {
+                /* Someone is handling a global hotkey, ignore it */
+#ifdef DEBUG_XEVENTS
+                printf("window %p: FocusOut (NotifyGrab, ignoring)\n", data);
+#endif
+                break;
+            }
             if (xevent.xfocus.detail == NotifyInferior) {
                 /* We still have focus if a child gets focus */
 #ifdef DEBUG_XEVENTS