Restore no cursor clipping in Locked mode on non-SDL input to avoid issues

This commit is contained in:
Wojtek Figat
2026-03-26 23:52:24 +01:00
parent c30c56e8eb
commit 5773dc47f4

View File

@@ -155,6 +155,7 @@ void Screen::SetCursorLock(CursorLockMode mode)
bool inRelativeMode = Input::Mouse->IsRelative();
if (mode == CursorLockMode::Clipped)
win->StartClippingCursor(bounds);
#if PLATFORM_SDL
else if (mode == CursorLockMode::Locked)
{
// Use mouse clip region to restrict the cursor in one spot
@@ -162,6 +163,10 @@ void Screen::SetCursorLock(CursorLockMode mode)
}
else if (CursorLock == CursorLockMode::Locked || CursorLock == CursorLockMode::Clipped)
win->EndClippingCursor();
#else
else if (CursorLock == CursorLockMode::Clipped)
win->EndClippingCursor();
#endif
// Enable relative mode when cursor is restricted
if (mode != CursorLockMode::None)