changeset 2025:7312feb88dad

Allow grabing mouse by locking its position
author Patrice Mandin <patmandin@gmail.com>
date Tue, 12 Sep 2006 19:47:40 +0000
parents cb0fd9cdd2a9
children a5d0758f88d8
files src/video/gem/SDL_gemmouse.c src/video/gem/SDL_gemwm.c
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/gem/SDL_gemmouse.c	Tue Sep 12 19:44:51 2006 +0000
+++ b/src/video/gem/SDL_gemmouse.c	Tue Sep 12 19:47:40 2006 +0000
@@ -167,10 +167,12 @@
 {
     /* If the mouse is hidden and input is grabbed, we use relative mode */
     if ((!(SDL_cursorstate & CURSOR_VISIBLE)) &&
-        /*(this->input_grab != SDL_GRAB_OFF) && *//* Damn GEM can not grab */
+        (this->input_grab != SDL_GRAB_OFF) &&
         (SDL_GetAppState() & SDL_APPACTIVE)) {
+        SDL_AtariXbios_LockMousePosition(SDL_TRUE);
         GEM_mouse_relative = SDL_TRUE;
     } else {
+        SDL_AtariXbios_LockMousePosition(SDL_FALSE);
         GEM_mouse_relative = SDL_FALSE;
         graf_mouse(M_ON, NULL);
     }
--- a/src/video/gem/SDL_gemwm.c	Tue Sep 12 19:44:51 2006 +0000
+++ b/src/video/gem/SDL_gemwm.c	Tue Sep 12 19:47:40 2006 +0000
@@ -113,7 +113,11 @@
 SDL_GrabMode
 GEM_GrabInput(_THIS, SDL_GrabMode mode)
 {
-    return SDL_GRAB_OFF;
+    if (this->screen == NULL) {
+        return SDL_GRAB_OFF;
+    }
+
+    return mode;
 }
 
 /* vi: set ts=4 sw=4 expandtab: */