Correctly manage mouse relative motion
authorPatrice Mandin <patmandin@gmail.com>
Wed, 25 Jan 2006 20:36:21 +0000
changeset 1267fdc7ef6ecab4
parent 1266 a7bea6db3c3e
child 1268 f098b247299d
Correctly manage mouse relative motion
src/video/gem/SDL_gemevents.c
src/video/gem/SDL_gemmouse.c
     1.1 --- a/src/video/gem/SDL_gemevents.c	Wed Jan 25 18:11:56 2006 +0000
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Wed Jan 25 20:36:21 2006 +0000
     1.3 @@ -382,13 +382,13 @@
     1.4  	}
     1.5  
     1.6  	/* Mouse motion ? */
     1.7 -	if ((prevmousex!=mx) || (prevmousey!=my)) {
     1.8 -		if (GEM_mouse_relative) {
     1.9 -			if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) {
    1.10 -				SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
    1.11 -				SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
    1.12 -			}
    1.13 -		} else {
    1.14 +	if (GEM_mouse_relative) {
    1.15 +		if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
    1.16 +			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
    1.17 +			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
    1.18 +		}
    1.19 +	} else {
    1.20 +		if ((prevmousex!=mx) || (prevmousey!=my)) {
    1.21  			int posx, posy;
    1.22  
    1.23  			/* Give mouse position relative to window position */
     2.1 --- a/src/video/gem/SDL_gemmouse.c	Wed Jan 25 18:11:56 2006 +0000
     2.2 +++ b/src/video/gem/SDL_gemmouse.c	Wed Jan 25 20:36:21 2006 +0000
     2.3 @@ -165,8 +165,8 @@
     2.4  void GEM_CheckMouseMode(_THIS)
     2.5  {
     2.6  	/* If the mouse is hidden and input is grabbed, we use relative mode */
     2.7 -	if ( !(SDL_cursorstate & CURSOR_VISIBLE) &&
     2.8 -		(this->input_grab != SDL_GRAB_OFF) &&
     2.9 +	if ( (!(SDL_cursorstate & CURSOR_VISIBLE)) &&
    2.10 +		/*(this->input_grab != SDL_GRAB_OFF) && */ /* Damn GEM can not grab */
    2.11               (SDL_GetAppState() & SDL_APPACTIVE) ) {
    2.12  		GEM_mouse_relative = SDL_TRUE;
    2.13  	} else {