Index: libsdl1.2-1.2.14/src/video/x11/SDL_x11events.c
===================================================================
--- libsdl1.2-1.2.14.orig/src/video/x11/SDL_x11events.c	2010-04-06 19:29:05.000000000 +0100
+++ libsdl1.2-1.2.14/src/video/x11/SDL_x11events.c	2010-04-06 19:29:46.000000000 +0100
@@ -423,12 +423,15 @@
 if ( xevent.xcrossing.mode == NotifyUngrab )
 printf("Mode: NotifyUngrab\n");
 #endif
-		if ( this->input_grab == SDL_GRAB_OFF ) {
-			posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+		if ( (xevent.xcrossing.mode != NotifyGrab) &&
+		     (xevent.xcrossing.mode != NotifyUngrab) ) {
+			if ( this->input_grab == SDL_GRAB_OFF ) {
+				posted = SDL_PrivateAppActive(1, SDL_APPMOUSEFOCUS);
+			}
+			posted = SDL_PrivateMouseMotion(0, 0,
+					xevent.xcrossing.x,
+					xevent.xcrossing.y);
 		}
-		posted = SDL_PrivateMouseMotion(0, 0,
-				xevent.xcrossing.x,
-				xevent.xcrossing.y);
 	    }
 	    break;
 
