Skip to content

Commit

Permalink
Correctly manage mouse relative motion
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Jan 25, 2006
1 parent 0647b35 commit 6583477
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions src/video/gem/SDL_gemmouse.c
Expand Up @@ -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 {
Expand Down

0 comments on commit 6583477

Please sign in to comment.