From 7fa14139d807230ddf23f901d50684eda8250c3c Mon Sep 17 00:00:00 2001 From: Jupeyy Date: Tue, 25 Apr 2023 18:45:03 +0200 Subject: [PATCH] Fix input as the comments suggest for the next SDL version SDL fixed the bug on Windows that releasing the mouse while tabbing out directly refocuses the window, which broke desktop fullscreen (and maybe windowed fullscreen) --- src/engine/client/input.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index af57890b8..65bcbd570 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -720,8 +720,7 @@ int CInput::Update() case SDL_WINDOWEVENT_FOCUS_GAINED: if(m_InputGrabbed) { - // Enable this in case SDL 2.0.16 has major bugs or 2.0.18 still doesn't fix tabbing out with relative mouse - // MouseModeRelative(); + MouseModeRelative(); // Clear pending relative mouse motion SDL_GetRelativeMouseState(nullptr, nullptr); } @@ -733,8 +732,7 @@ int CInput::Update() IgnoreKeys = true; if(m_InputGrabbed) { - // Enable this in case SDL 2.0.16 has major bugs or 2.0.18 still doesn't fix tabbing out with relative mouse - // MouseModeAbsolute(); + MouseModeAbsolute(); // Remember that we had relative mouse m_InputGrabbed = true; }