[WEB] chrome mobile loses focus after SDL_ShowMessageBox
to reproduce:
- open emu in chrome mobile
- press loadstate
- notice the error because it failed to loadstate (expected)
- press okay on the alert
- em now fires
EMSCRIPTEN_EVENT_BLUR, sdl gets it and now firesSDL_WINDOWEVENT_FOCUS_LOST. - focus is never returned.
i think it only happens in chrome mobile. it works on firefox and safari ios, as well as desktop and desktop browsers.
haven't looked into how emscripten decides to fire a focus event yet. will need to find a fix and pr it.
useful links:
-
SDL_ShowMessageBoxdoes a simple js alert https://github.com/libsdl-org/SDL/blob/00452e47fa022314b4c21af2d4e5b63a53f89b8f/src/video/SDL_video.c#L4591 -
sdl basically wraps around emscripten html wapper api https://github.com/libsdl-org/SDL/blob/10e1ef00e29479f3ac0ba4d0bf3e0083fca8b2a0/src/video/emscripten/SDL_emscriptenevents.c#L442.
note related to the issue, but the variable name for the event data is wrong, copy and paste error https://github.com/libsdl-org/SDL/blob/10e1ef00e29479f3ac0ba4d0bf3e0083fca8b2a0/src/video/emscripten/SDL_emscriptenevents.c#L432