Commit 0a8520eb authored by Patrice Mandin's avatar Patrice Mandin

Correctly manage mouse relative motion

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401270
parent 7109c9a2
...@@ -382,13 +382,13 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks) ...@@ -382,13 +382,13 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks)
} }
/* Mouse motion ? */ /* Mouse motion ? */
if ((prevmousex!=mx) || (prevmousey!=my)) {
if (GEM_mouse_relative) { if (GEM_mouse_relative) {
if ((SDL_AtariXbios_mousex!=0) || (SDL_AtariXbios_mousey!=0)) { if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey); SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0; SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
} }
} else { } else {
if ((prevmousex!=mx) || (prevmousey!=my)) {
int posx, posy; int posx, posy;
/* Give mouse position relative to window position */ /* Give mouse position relative to window position */
......
...@@ -165,8 +165,8 @@ void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y) ...@@ -165,8 +165,8 @@ void GEM_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
void GEM_CheckMouseMode(_THIS) void GEM_CheckMouseMode(_THIS)
{ {
/* If the mouse is hidden and input is grabbed, we use relative mode */ /* If the mouse is hidden and input is grabbed, we use relative mode */
if ( !(SDL_cursorstate & CURSOR_VISIBLE) && if ( (!(SDL_cursorstate & CURSOR_VISIBLE)) &&
(this->input_grab != SDL_GRAB_OFF) && /*(this->input_grab != SDL_GRAB_OFF) && */ /* Damn GEM can not grab */
(SDL_GetAppState() & SDL_APPACTIVE) ) { (SDL_GetAppState() & SDL_APPACTIVE) ) {
GEM_mouse_relative = SDL_TRUE; GEM_mouse_relative = SDL_TRUE;
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment