diff --git a/src/video/gem/SDL_gemmouse.c b/src/video/gem/SDL_gemmouse.c index 98ae264e4..e8b1e0b0f 100644 --- a/src/video/gem/SDL_gemmouse.c +++ b/src/video/gem/SDL_gemmouse.c @@ -176,10 +176,12 @@ 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) && */ /* Damn GEM can not grab */ + (this->input_grab != SDL_GRAB_OFF) && (SDL_GetAppState() & SDL_APPACTIVE) ) { + SDL_AtariXbios_LockMousePosition(SDL_TRUE); GEM_mouse_relative = SDL_TRUE; } else { + SDL_AtariXbios_LockMousePosition(SDL_FALSE); GEM_mouse_relative = SDL_FALSE; graf_mouse(M_ON, NULL); } diff --git a/src/video/gem/SDL_gemwm.c b/src/video/gem/SDL_gemwm.c index 28d26443b..c6b299839 100644 --- a/src/video/gem/SDL_gemwm.c +++ b/src/video/gem/SDL_gemwm.c @@ -108,5 +108,9 @@ int GEM_IconifyWindow(_THIS) SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode) { - return SDL_GRAB_OFF; + if (this->screen == NULL) { + return SDL_GRAB_OFF; + } + + return mode; }