r11059 - in packages/trunk/boswars/debian: . patches

Marc Dequènes duck at alioth.debian.org
Wed Jul 7 01:47:04 UTC 2010


Author: duck
Date: 2010-07-07 01:47:00 +0000 (Wed, 07 Jul 2010)
New Revision: 11059

Added:
   packages/trunk/boswars/debian/patches/sdl_disable_mouse_relative_mode
Modified:
   packages/trunk/boswars/debian/changelog
   packages/trunk/boswars/debian/patches/series
Log:
[fix] 559615

Modified: packages/trunk/boswars/debian/changelog
===================================================================
--- packages/trunk/boswars/debian/changelog	2010-07-07 00:31:28 UTC (rev 11058)
+++ packages/trunk/boswars/debian/changelog	2010-07-07 01:47:00 UTC (rev 11059)
@@ -7,8 +7,11 @@
   * Stopped uselessly suggesting python (Closes: #568330).
   * Added patch from KiBi to add buildsys support to kfreebsd-*
     architectures (Closes: #585673).
+  * Added patch from Kalle Olavi Niemitalo <kon at iki.fi> to disable SDL
+    mouse relative mode causing problems with tablets and similar input
+    devices (Closes: #559615).
 
- -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Wed, 07 Jul 2010 02:29:50 +0200
+ -- Marc Dequènes (Duck) <Duck at DuckCorp.org>  Wed, 07 Jul 2010 03:45:44 +0200
 
 boswars (2.6.1-1) unstable; urgency=low
 

Added: packages/trunk/boswars/debian/patches/sdl_disable_mouse_relative_mode
===================================================================
--- packages/trunk/boswars/debian/patches/sdl_disable_mouse_relative_mode	                        (rev 0)
+++ packages/trunk/boswars/debian/patches/sdl_disable_mouse_relative_mode	2010-07-07 01:47:00 UTC (rev 11059)
@@ -0,0 +1,69 @@
+From 5c740e3a68150346323c70f9141014d44a91dbcc Mon Sep 17 00:00:00 2001
+From: Kalle Olavi Niemitalo <kon at iki.fi>
+Date: Fri, 15 Jan 2010 02:08:34 +0200
+Subject: [PATCH] Fix tablet input in full-screen mode
+
+Work around an SDL 1.2 misfeature that makes Bos Wars in full-screen
+mode unplayable with tablet devices that report absolute coordinates.
+
+Fixes Debian bug 559615.
+---
+ engine/video/sdl.cpp |   42 ++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/engine/video/sdl.cpp b/engine/video/sdl.cpp
+index c8cfc01..ccaeb57 100644
+--- a/engine/video/sdl.cpp
++++ b/engine/video/sdl.cpp
+@@ -381,6 +381,48 @@ void InitVideoSdl(void)
+ 	Uint32 flags;
+ 
+ 	if (SDL_WasInit(SDL_INIT_VIDEO) == 0) {
++#ifdef HAVE_X
++		// Fix tablet input in full-screen mode.
++		//
++		// By default, SDL 1.2 on X11 uses mouse relative mode
++		// if the mouse cursor is hidden and input is grabbed.
++		// In this mode, SDL attempts to report the direction
++		// in which the mouse is moving.  SDL computes this
++		// from the mouse-cursor coordinates it gets from X.
++		// If the mouse cursor of X were to hit an edge of the
++		// screen, SDL would not know whether the user keeps
++		// moving the mouse in that direction.  To prevent
++		// that, SDL warps the mouse cursor of X back to the
++		// center of the screen whenever it gets too far.
++		// SDL then compensates for this warping in its
++		// relative-motion computations, and uses the relative
++		// coordinates to maintain its own idea of the mouse
++		// cursor location, separately from what X thinks.
++		//
++		// All of the above works great with mice but fails
++		// horribly with tablet or touch-screen devices, where
++		// the coordinates reported by X depend only on the
++		// position of the stylus and not at all on where SDL
++		// previously warped the pointer.  Because Bos Wars
++		// doesn't actually care about relative mouse motion,
++		// let's just disable that whole feature in SDL.  The
++		// easiest way to do that is by setting an environment
++		// variable.  Do this before SDL_Init in case that
++		// caches the value.
++		//
++		// SDL 1.2 documentation warns that environment
++		// variables are mostly for debugging and might not be
++		// supported in future SDL releases.  In that event,
++		// Bos Wars can instead use the same trick as Barrage
++		// does: tell SDL to show the mouse cursor, but make
++		// all of its pixels transparent, so it's actually
++		// invisible.  However, SDL 1.3 is apparently going to
++		// support tablet devices natively, so this might not
++		// be needed then.
++		static char MouseRelative0[] = "SDL_MOUSE_RELATIVE=0";
++		SDL_putenv(MouseRelative0); // doesn't want const
++#endif
++
+ 		if (SDL_Init(
+ #ifdef DEBUG
+ 				SDL_INIT_NOPARACHUTE |
+-- 
+1.6.6
+

Modified: packages/trunk/boswars/debian/patches/series
===================================================================
--- packages/trunk/boswars/debian/patches/series	2010-07-07 00:31:28 UTC (rev 11058)
+++ packages/trunk/boswars/debian/patches/series	2010-07-07 01:47:00 UTC (rev 11059)
@@ -1 +1,2 @@
 buildsys_gnukfreebsd_support
+sdl_disable_mouse_relative_mode




More information about the Pkg-games-commits mailing list