Skip to content
Permalink
Browse files
Fixed bug 1155 - Should SDL_WM_GrabInput()/X11_GrabInputNoLock() block?
Makes SDL-1.2 SDL_WM_GrabInput() non-blocking in case of SDL window is not
viewable. Patch provided by <pbonzini@redhat.com>.
  • Loading branch information
slouken committed Aug 28, 2018
1 parent 1b548a8 commit 0d35dc0a838ec9854c792ca36d681f03db3f72e3
Showing 1 changed file with 2 additions and 1 deletion.
@@ -352,13 +352,14 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, SDL_GrabMode mode)
result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
GrabModeAsync, GrabModeAsync,
SDL_Window, None, CurrentTime);
if ( result == GrabSuccess ) {
if ( result == GrabSuccess || result == GrabNotViewable ) {
break;
}
SDL_Delay(100);
}
if ( result != GrabSuccess ) {
/* Uh, oh, what do we do here? */ ;
return(SDL_GRAB_OFF);
}
/* Now grab the keyboard */
XGrabKeyboard(SDL_Display, WMwindow, True,

0 comments on commit 0d35dc0

Please sign in to comment.