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)
This commit is contained in:
Jupeyy 2023-04-25 18:45:03 +02:00
parent 181d831411
commit 7fa14139d8

View file

@ -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;
}