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