Commit e5b239fe authored by Patrice Mandin's avatar Patrice Mandin

Allow grabing mouse by locking its position

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%402078
parent faf3d7ce
...@@ -176,10 +176,12 @@ void GEM_CheckMouseMode(_THIS) ...@@ -176,10 +176,12 @@ 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) && */ /* Damn GEM can not grab */ (this->input_grab != SDL_GRAB_OFF) &&
(SDL_GetAppState() & SDL_APPACTIVE) ) { (SDL_GetAppState() & SDL_APPACTIVE) ) {
SDL_AtariXbios_LockMousePosition(SDL_TRUE);
GEM_mouse_relative = SDL_TRUE; GEM_mouse_relative = SDL_TRUE;
} else { } else {
SDL_AtariXbios_LockMousePosition(SDL_FALSE);
GEM_mouse_relative = SDL_FALSE; GEM_mouse_relative = SDL_FALSE;
graf_mouse(M_ON, NULL); graf_mouse(M_ON, NULL);
} }
......
...@@ -108,5 +108,9 @@ int GEM_IconifyWindow(_THIS) ...@@ -108,5 +108,9 @@ int GEM_IconifyWindow(_THIS)
SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode) SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode)
{ {
if (this->screen == NULL) {
return SDL_GRAB_OFF; return SDL_GRAB_OFF;
}
return mode;
} }
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