otaylor / rpms / SDL

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