65caa9
Makes SDL-1.2 SDL_WM_GrabInput() non-blocking in case of SDL window is not
65caa9
viewable. Patch provided by <pbonzini@redhat.com>.
65caa9
See <http://bugzilla.libsdl.org/show_bug.cgi?id=1155>.
65caa9
65caa9
--- ./src/video/x11/SDL_x11wm.c	2007-12-31 04:48:13.000000000 +0000
65caa9
+++ ./src/video/x11/SDL_x11wm.c	2009-01-15 10:27:14.000000000 +0000
65caa9
@@ -351,13 +351,14 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, 
65caa9
 			result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
65caa9
 						GrabModeAsync, GrabModeAsync,
65caa9
 						SDL_Window, None, CurrentTime);
65caa9
-			if ( result == GrabSuccess ) {
65caa9
+			if ( result == GrabSuccess || result == GrabNotViewable ) {
65caa9
 				break;
65caa9
 			}
65caa9
 			SDL_Delay(100);
65caa9
 		}
65caa9
 		if ( result != GrabSuccess ) {
65caa9
 			/* Uh, oh, what do we do here? */ ;
65caa9
+			return(SDL_GRAB_OFF);
65caa9
 		}
65caa9
 		/* Now grab the keyboard */
65caa9
 		XGrabKeyboard(SDL_Display, WMwindow, True,