From 6c85c4e1d39f6d686d19595539f6b349d01df887 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 5 Jan 2020 18:39:16 +0100 Subject: [PATCH 1/3] Fix mouse being grabbed even when not used --- src/sdl/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index e6a40327b..785d8c4dc 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -110,7 +110,7 @@ static SDL_bool disable_fullscreen = SDL_FALSE; #define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value static SDL_bool disable_mouse = SDL_FALSE; #define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus) -#define IGNORE_MOUSE (!cv_alwaysgrabmouse.value && (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL)) +#define IGNORE_MOUSE (!USE_MOUSEINPUT || (!cv_alwaysgrabmouse.value && (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL))) #define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN) #define MOUSEBUTTONS_MAX MOUSEBUTTONS From 88c8049c77f3c38768de19c02394f5b888028f96 Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 5 Jan 2020 18:39:16 +0100 Subject: [PATCH 2/3] Revert "Fix mouse being grabbed even when not used" This reverts commit 6c85c4e1d39f6d686d19595539f6b349d01df887. --- src/sdl/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 785d8c4dc..e6a40327b 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -110,7 +110,7 @@ static SDL_bool disable_fullscreen = SDL_FALSE; #define USE_FULLSCREEN (disable_fullscreen||!allow_fullscreen)?0:cv_fullscreen.value static SDL_bool disable_mouse = SDL_FALSE; #define USE_MOUSEINPUT (!disable_mouse && cv_usemouse.value && havefocus) -#define IGNORE_MOUSE (!USE_MOUSEINPUT || (!cv_alwaysgrabmouse.value && (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL))) +#define IGNORE_MOUSE (!cv_alwaysgrabmouse.value && (menuactive || paused || con_destlines || chat_on || gamestate != GS_LEVEL)) #define MOUSE_MENU false //(!disable_mouse && cv_usemouse.value && menuactive && !USE_FULLSCREEN) #define MOUSEBUTTONS_MAX MOUSEBUTTONS From e847777a35eab5a5c3e05bd189b6f308457ca5db Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Sun, 5 Jan 2020 18:39:16 +0100 Subject: [PATCH 3/3] Fix mouse being grabbed even when not used The other way around this time. --- src/sdl/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index e6a40327b..2b8633e5b 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -388,7 +388,7 @@ void I_UpdateMouseGrab(void) { if (SDL_WasInit(SDL_INIT_VIDEO) == SDL_INIT_VIDEO && window != NULL && SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window - && !IGNORE_MOUSE) + && USE_MOUSEINPUT && !IGNORE_MOUSE) SDLdoGrabMouse(); }