Remember desired cursor hide state

Fixes #511
This commit is contained in:
Cameron Gutman
2021-01-30 11:08:01 -06:00
parent 5309a02f6d
commit 1cd66419d4
4 changed files with 7 additions and 3 deletions

View File

@@ -146,7 +146,8 @@ void SdlInputHandler::flushMousePositionUpdate()
// executes.
SDL_Event event;
event.type = SDL_USEREVENT;
event.user.code = mouseInVideoRegion ? SDL_CODE_HIDE_CURSOR : SDL_CODE_SHOW_CURSOR;
event.user.code = (mouseInVideoRegion && m_MouseCursorCapturedVisibilityState == SDL_DISABLE) ?
SDL_CODE_HIDE_CURSOR : SDL_CODE_SHOW_CURSOR;
SDL_PushEvent(&event);
if (!mouseInVideoRegion && buttonState != 0) {