[SDL] Don't block SDL_WM_GrabInput() if window is not viewable

Petr Pisar ppisar at fedoraproject.org
Fri Aug 26 09:32:41 UTC 2011


commit e50f4086496beee6d7000edb759bbcc9ffbe6a1a
Author: Petr Písař <ppisar at redhat.com>
Date:   Fri Aug 26 11:32:11 2011 +0200

    Don't block SDL_WM_GrabInput() if window is not viewable

 SDL-1.2.10-GrabNotViewable.patch |   22 ++++++++++++++++++++++
 SDL.spec                         |    8 +++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/SDL-1.2.10-GrabNotViewable.patch b/SDL-1.2.10-GrabNotViewable.patch
new file mode 100644
index 0000000..128cf35
--- /dev/null
+++ b/SDL-1.2.10-GrabNotViewable.patch
@@ -0,0 +1,22 @@
+Makes SDL-1.2 SDL_WM_GrabInput() non-blocking in case of SDL window is not
+viewable. Patch provided by <pbonzini at redhat.com>.
+See <http://bugzilla.libsdl.org/show_bug.cgi?id=1155>.
+
+--- ./src/video/x11/SDL_x11wm.c	2007-12-31 04:48:13.000000000 +0000
++++ ./src/video/x11/SDL_x11wm.c	2009-01-15 10:27:14.000000000 +0000
+@@ -351,13 +351,14 @@ SDL_GrabMode X11_GrabInputNoLock(_THIS, 
+ 			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,
diff --git a/SDL.spec b/SDL.spec
index 9978bbf..71a2952 100644
--- a/SDL.spec
+++ b/SDL.spec
@@ -1,7 +1,7 @@
 Summary: A cross-platform multimedia library
 Name: SDL
 Version: 1.2.14
-Release: 12%{?dist}
+Release: 13%{?dist}
 # Source: http://www.libsdl.org/release/%%{name}-%%{version}.tar.gz
 # To create the repackaged archive use ./repackage.sh %%{version}
 Source0: %{name}-%{version}_repackaged.tar.gz
@@ -24,6 +24,8 @@ Patch6: SDL-1.2.14-linux_2.6_joystick.patch
 Patch7: SDL-1.2.14-SDL_BlitCopyOverlap_memcpy.patch
 # nasm-2.09 aliased elf to elf32, in upstream, sdl1152, rh678818
 Patch8: SDL-1.2.14-nasm-2.09-compat.patch
+# Submitted to upstream as sdl1155, rh480065
+Patch9: SDL-1.2.10-GrabNotViewable.patch
 
 URL: http://www.libsdl.org/
 License: LGPLv2+
@@ -86,6 +88,7 @@ static SDL applications.
 %patch6 -p1 -b .linux_2.6_joystick
 %patch7 -p1 -b .SDL_BlitCopyOverlap_memcpy
 %patch8 -p1 -b .nasm209
+%patch9 -p0 -b .grabnotviewable
 for F in CREDITS; do 
     iconv -f iso8859-1 -t utf-8 < "$F" > "${F}.utf"
     touch --reference "$F" "${F}.utf"
@@ -148,6 +151,9 @@ rm -rf %{buildroot}
 %{_libdir}/lib*.a
 
 %changelog
+* Fri Aug 26 2011 Petr Pisar <ppisar at redhat.com> - 1.2.14-13
+- Don't block SDL_WM_GrabInput() if window is not viewable (bug #480065)
+
 * Thu Feb 24 2011 Petr Pisar <ppisar at redhat.com> - 1.2.14-12
 - Adapt to nasm-2.09 (bug #678818)
 


More information about the scm-commits mailing list