diff --git a/src/backends/sdl/input.c b/src/backends/sdl/input.c index f526ac99..9bc77bd7 100644 --- a/src/backends/sdl/input.c +++ b/src/backends/sdl/input.c @@ -569,13 +569,13 @@ IN_KeyboardInit(Key_Event_fp_t fp) /* SDL stuff. Moved here from IN_BackendInit because this must be done after video is initialized. */ -#if SDL_VERSION_ATLEAST(2, 0, 0) - SDL_SetRelativeMouseMode(SDL_TRUE); have_grab = GLimp_InputIsGrabbed(); +#if SDL_VERSION_ATLEAST(2, 0, 0) + if (have_grab) + SDL_SetRelativeMouseMode(SDL_TRUE); #else SDL_EnableUNICODE(0); SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - have_grab = (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON); #endif } diff --git a/src/backends/sdl/refresh.c b/src/backends/sdl/refresh.c index b9908d64..6610466d 100644 --- a/src/backends/sdl/refresh.c +++ b/src/backends/sdl/refresh.c @@ -692,7 +692,7 @@ void GLimp_GrabInput(qboolean grab) { #if SDL_VERSION_ATLEAST(2, 0, 0) SDL_SetWindowGrab(window, grab ? SDL_TRUE : SDL_FALSE); - if(grab) + if (grab) SDL_SetRelativeMouseMode(SDL_TRUE); #else @@ -708,8 +708,7 @@ qboolean GLimp_InputIsGrabbed() #if SDL_VERSION_ATLEAST(2, 0, 0) return SDL_GetWindowGrab(window) ? true : false; #else - SDL_GrabMode m = SDL_WM_GrabInput(SDL_GRAB_QUERY); - return m == SDL_GRAB_ON; + return (SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON); #endif }