Generate synthetic mouse button up if the mouse has left the window and the button is raised

This commit is contained in:
Cameron Gutman
2020-05-07 19:26:02 -07:00
parent 514a8575a2
commit 0428bc8fe3
4 changed files with 53 additions and 0 deletions

View File

@@ -1221,6 +1221,9 @@ void Session::exec(int displayOriginX, int displayOriginY)
if (event.window.event == SDL_WINDOWEVENT_FOCUS_LOST) {
m_InputHandler->notifyFocusLost();
}
else if (event.window.event == SDL_WINDOWEVENT_LEAVE) {
m_InputHandler->notifyMouseLeave();
}
// Capture the mouse on SDL_WINDOWEVENT_ENTER if needed
if (needsFirstEnterCapture && event.window.event == SDL_WINDOWEVENT_ENTER) {