Ignore mouse events outside the video region

This commit is contained in:
Cameron Gutman
2020-07-12 15:06:36 -07:00
parent 912e51d863
commit ab5025efbf
4 changed files with 71 additions and 5 deletions

View File

@@ -1195,8 +1195,19 @@ void Session::exec(int displayOriginX, int displayOriginY)
goto DispatchDeferredCleanup;
case SDL_USEREVENT:
SDL_assert(event.user.code == SDL_CODE_FRAME_READY);
m_VideoDecoder->renderFrameOnMainThread();
switch (event.user.code) {
case SDL_CODE_FRAME_READY:
m_VideoDecoder->renderFrameOnMainThread();
break;
case SDL_CODE_HIDE_CURSOR:
SDL_ShowCursor(SDL_DISABLE);
break;
case SDL_CODE_SHOW_CURSOR:
SDL_ShowCursor(SDL_ENABLE);
break;
default:
SDL_assert(false);
}
break;
case SDL_WINDOWEVENT: