HaroonGhawsi / naclports

Automatically exported from code.google.com/p/naclports
0 stars 0 forks source link

SDL_QUIT for tab close event #224

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I received the following suggestion:

> Emscripten has an "emscripten_set_beforeunload_callback" which can react to 
tab closed events. We added this to Quake2 net_humblenet.cpp so Quake itself 
can properly close the connection. Perhaps SDL could use this callback to send 
an SDL_QUIT when the tab is closed?

sbc says:

> One problem I see this this approach is the tab closed event will almost 
certainly want to run synchronously, right?   And all the game code is running 
on a background thread.. so it could get messy/complicated.  Perhaps the new 
postMessageAndAwaitResponse might be useful here.
>
> I'm more than happy to work on making out SDK port better if we have real 
world use cases.

Original issue reported on code.google.com by j...@chromium.org on 22 Jun 2015 at 11:52