Skip to content

Commit

Permalink
Fixed bug 1155 - Should SDL_WM_GrabInput()/X11_GrabInputNoLock() block?
Browse files Browse the repository at this point in the history
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 0d35dc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/x11/SDL_x11wm.c
Expand Up @@ -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,
Expand Down

0 comments on commit 0d35dc0

Please sign in to comment.