[X11] Ignore both NotifyGrab and NotifyUngrab modes in FocusIn/FocusOut events
authorGabriel Jacobo <gabomdq@gmail.com>
Sun, 10 Nov 2013 20:38:50 -0300
changeset 7945 764129077d18
parent 7944 f19c0aca56aa
child 7946 57c34a54b7c2
[X11] Ignore both NotifyGrab and NotifyUngrab modes in FocusIn/FocusOut events
src/video/x11/SDL_x11events.c
--- a/src/video/x11/SDL_x11events.c	Sun Nov 10 20:13:27 2013 -0300
+++ b/src/video/x11/SDL_x11events.c	Sun Nov 10 20:38:50 2013 -0300
@@ -399,6 +399,14 @@
 
         /* Gaining input focus? */
     case FocusIn:{
+            if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) {
+                /* Someone is handling a global hotkey, ignore it */
+#ifdef DEBUG_XEVENTS
+                printf("window %p: FocusIn (NotifyGrab/NotifyUngrab, ignoring)\n", data);
+#endif
+                break;
+            }
+
             if (xevent.xfocus.detail == NotifyInferior) {
 #ifdef DEBUG_XEVENTS
                 printf("window %p: FocusIn (NotifierInferior, ignoring)\n", data);
@@ -428,10 +436,10 @@
 
         /* Losing input focus? */
     case FocusOut:{
-            if (xevent.xfocus.mode == NotifyGrab) {
+            if (xevent.xfocus.mode == NotifyGrab || xevent.xfocus.mode == NotifyUngrab) {
                 /* Someone is handling a global hotkey, ignore it */
 #ifdef DEBUG_XEVENTS
-                printf("window %p: FocusOut (NotifyGrab, ignoring)\n", data);
+                printf("window %p: FocusOut (NotifyGrab/NotifyUngrab, ignoring)\n", data);
 #endif
                 break;
             }