# HG changeset patch # User Patrice Mandin # Date 1158089658 0 # Node ID 5d14acfdf84da9b370b0d495a07478eba7bd8b8f # Parent 9ffd318e7b64c24b5274455d7ec8effb816d3b08 Allow grabing mouse by locking its position diff -r 9ffd318e7b64 -r 5d14acfdf84d src/video/gem/SDL_gemmouse.c --- a/src/video/gem/SDL_gemmouse.c Tue Sep 12 19:33:33 2006 +0000 +++ b/src/video/gem/SDL_gemmouse.c Tue Sep 12 19:34:18 2006 +0000 @@ -176,10 +176,12 @@ /* 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 -r 9ffd318e7b64 -r 5d14acfdf84d src/video/gem/SDL_gemwm.c --- a/src/video/gem/SDL_gemwm.c Tue Sep 12 19:33:33 2006 +0000 +++ b/src/video/gem/SDL_gemwm.c Tue Sep 12 19:34:18 2006 +0000 @@ -108,5 +108,9 @@ SDL_GrabMode GEM_GrabInput(_THIS, SDL_GrabMode mode) { - return SDL_GRAB_OFF; + if (this->screen == NULL) { + return SDL_GRAB_OFF; + } + + return mode; }