Unfortunately the SDL API does not have a design that would allow
doing this from within SDL code. The best closest behavior you can get
with SDL API is the "deferred" behavior of fullscreen happening the
next time you click on the canvas. This deferring behavior has been
explicitly created as a workaround fallback to make existing apps work
as close to possible.
If you want to fix the behavior proper, you will need to register
HTML5 event callback handler (from html5.h) to one of the input
events, and use the HTML5 fullscreen API from there. That will
immediately give fullscreen mode to appear without deferring.
It would be possible to add mixed support to calling
SDL_SetWindowFullscreen() from a html5.h-based event handler callback,
but currently I think that does not work. There was a bug report or an
emscripten-discuss thread about this mixed
html5.h+SDL_SetWindowFullscreen() but can't find it with some
searching now. Basically one will need to hack SDL API to understand
that it's ok to do fullscreen requests from within HTML5 event
handlers, it's currently not aware of them.
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
emscripten-disc...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.