Correctly manage mouse relative motion
authorPatrice Mandin <patmandin@gmail.com>
Wed, 25 Jan 2006 20:36:21 +0000
changeset 1267 fdc7ef6ecab4
parent 1266 a7bea6db3c3e
child 1268 f098b247299d
Correctly manage mouse relative motion
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemmouse.c
--- a/src/video/gem/SDL_gemevents.c	Wed Jan 25 18:11:56 2006 +0000
+++ b/src/video/gem/SDL_gemevents.c	Wed Jan 25 20:36:21 2006 +0000
@@ -382,13 +382,13 @@
 	}
 
 	/* Mouse motion ? */
-	if ((prevmousex!=mx) || (prevmousey!=my)) {
-		if (GEM_mouse_relative) {
-			if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) {
-				SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
-				SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
-			}
-		} else {
+	if (GEM_mouse_relative) {
+		if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
+			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
+			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
+		}
+	} else {
+		if ((prevmousex!=mx) || (prevmousey!=my)) {
 			int posx, posy;
 
 			/* Give mouse position relative to window position */
--- a/src/video/gem/SDL_gemmouse.c	Wed Jan 25 18:11:56 2006 +0000
+++ b/src/video/gem/SDL_gemmouse.c	Wed Jan 25 20:36:21 2006 +0000
@@ -165,8 +165,8 @@
 void GEM_CheckMouseMode(_THIS)
 {
 	/* If the mouse is hidden and input is grabbed, we use relative mode */
-	if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
-		(this->input_grab != SDL_GRAB_OFF) &&
+	if ( (!(SDL_cursorstate & CURSOR_VISIBLE)) &&
+		/*(this->input_grab != SDL_GRAB_OFF) && */ /* Damn GEM can not grab */
              (SDL_GetAppState() & SDL_APPACTIVE) ) {
 		GEM_mouse_relative = SDL_TRUE;
 	} else {