src/video/x11/SDL_x11events.c
changeset 4558 4d95152d9e39
parent 4556 cc06f306c053
child 4560 95352c671a6e
--- a/src/video/x11/SDL_x11events.c	Mon Jul 19 23:29:45 2010 -0700
+++ b/src/video/x11/SDL_x11events.c	Tue Jul 20 00:05:32 2010 -0700
@@ -25,7 +25,7 @@
 #include <sys/time.h>
 #include <signal.h>
 #include <unistd.h>
-#include <limits.h>	/* For INT_MAX */
+#include <limits.h> /* For INT_MAX */
 
 #include "SDL_x11video.h"
 #include "../../events/SDL_events_c.h"
@@ -92,8 +92,8 @@
     case EnterNotify:{
 #ifdef DEBUG_XEVENTS
             printf("EnterNotify! (%d,%d,%d)\n", 
-	           xevent.xcrossing.x,
- 	           xevent.xcrossing.y,
+                   xevent.xcrossing.x,
+                   xevent.xcrossing.y,
                    xevent.xcrossing.mode);
             if (xevent.xcrossing.mode == NotifyGrab)
                 printf("Mode: NotifyGrab\n");
@@ -108,15 +108,17 @@
     case LeaveNotify:{
 #ifdef DEBUG_XEVENTS
             printf("LeaveNotify! (%d,%d,%d)\n", 
-	           xevent.xcrossing.x,
- 	           xevent.xcrossing.y,
+                   xevent.xcrossing.x,
+                   xevent.xcrossing.y,
                    xevent.xcrossing.mode);
             if (xevent.xcrossing.mode == NotifyGrab)
                 printf("Mode: NotifyGrab\n");
             if (xevent.xcrossing.mode == NotifyUngrab)
                 printf("Mode: NotifyUngrab\n");
 #endif
-            if (xevent.xcrossing.detail != NotifyInferior) {
+            if (xevent.xcrossing.mode != NotifyGrab &&
+                xevent.xcrossing.mode != NotifyUngrab &&
+                xevent.xcrossing.detail != NotifyInferior) {
                 SDL_SetMouseFocus(NULL);
             }
         }