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>.

--HG--
branch : SDL-1.2
  • Loading branch information
slouken committed Aug 28, 2018
1 parent 4db44db commit 0596fda151df354261817f38030a436667fb5b55
Showing with 2 additions and 1 deletion.
  1. +2 −1 src/video/x11/SDL_x11wm.c
@@ -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 0596fda

Please sign in to comment.
You can’t perform that action at this time.