SDL-1.2.10-GrabNotViewable.patch 841 B

1234567891011121314151617181920212223
  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>.
  4. --- ./src/video/x11/SDL_x11wm.c 2007-12-31 04:48:13.000000000 +0000
  5. +++ ./src/video/x11/SDL_x11wm.c 2009-01-15 10:27:14.000000000 +0000
  6. @@ -351,13 +351,14 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS,
  7. result = XGrabPointer(SDL_Display, SDL_Window, True, 0,
  8. GrabModeAsync, GrabModeAsync,
  9. SDL_Window, None, CurrentTime);
  10. - if ( result == GrabSuccess ) {
  11. + if ( result == GrabSuccess || result == GrabNotViewable ) {
  12. break;
  13. }
  14. SDL_Delay(100);
  15. }
  16. if ( result != GrabSuccess ) {
  17. /* Uh, oh, what do we do here? */ ;
  18. + return(SDL_GRAB_OFF);
  19. }
  20. /* Now grab the keyboard */
  21. XGrabKeyboard(SDL_Display, WMwindow, True,