ITotalJustice / notorious_beeg

gba emulator written in c++23
https://notorious-beeg.netlify.app/
GNU General Public License v3.0
41 stars 4 forks source link

[WEB] chrome mobile loses focus after SDL_ShowMessageBox #91

Open ITotalJustice opened 2 years ago

ITotalJustice commented 2 years ago

to reproduce:

  1. open emu in chrome mobile
  2. press loadstate
  3. notice the error because it failed to loadstate (expected)
  4. press okay on the alert
  5. em now fires EMSCRIPTEN_EVENT_BLUR, sdl gets it and now fires SDL_WINDOWEVENT_FOCUS_LOST.
  6. 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:


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