From 658347761b5adcb81e929a844e92f92889a80785 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Wed, 25 Jan 2006 20:36:21 +0000 Subject: [PATCH] Correctly manage mouse relative motion --- src/video/gem/SDL_gemevents.c | 14 +++++++------- src/video/gem/SDL_gemmouse.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/video/gem/SDL_gemevents.c b/src/video/gem/SDL_gemevents.c index e1a40d8ea..26d33973f 100644 --- a/src/video/gem/SDL_gemevents.c +++ b/src/video/gem/SDL_gemevents.c @@ -382,13 +382,13 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks) } /* 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 */ diff --git a/src/video/gem/SDL_gemmouse.c b/src/video/gem/SDL_gemmouse.c index b6226c937..e21af628b 100644 --- a/src/video/gem/SDL_gemmouse.c +++ b/src/video/gem/SDL_gemmouse.c @@ -165,8 +165,8 @@ void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y) 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 {