Fix capturing mouse motion outside the window on sdl2-compat

This commit is contained in:
Cameron Gutman
2026-07-27 00:10:06 -05:00
parent 7794a42843
commit 7f7f2c26d0
4 changed files with 33 additions and 19 deletions
+4 -2
View File
@@ -128,8 +128,10 @@ void SdlInputHandler::handleMouseMotionEvent(SDL_MouseMotionEvent* event)
Uint32 buttonState = SDL_GetMouseState(nullptr, nullptr);
if (buttonState == 0) {
if (m_PendingMouseButtonsAllUpOnVideoRegionLeave) {
// Stop capturing the mouse now
SDL_CaptureMouse(SDL_FALSE);
if (m_NeedsManualCaptureOnLeave) {
// Stop capturing the mouse now
SDL_CaptureMouse(SDL_FALSE);
}
m_PendingMouseButtonsAllUpOnVideoRegionLeave = false;
}
}