Ah sorry, I should have been more clear, I'm complaining about the WHATWG Fullscreen API, *not* the emscripten API (which actually is a sane wrapper around the underlying mess).
Ok, rant time:
I think this is one of those cases where worst-case-scenario requirements (protect user from fishing attempts) led to an API which for the default-scenario is an annoyance both for the developer and the user. The pointerlock-API has the same problem, but is even worse. I sort of get the intent, but at some point somebody should either have said "guys what we do here is bullshit, let's go back to the drawing board", or alternatively somebody should have kicked the over-paranoid security-guys out the door (IMHO security should happen *under the hood*, it should ideally not deteriorate the developer-experience, and especially not the user-experience).
Annoyances of the Fullscreen API:
- Must be initiated from input event handler, this basically means a game needs some sort of start button. But the point of running games in a browser is to get the player right into the game, and not add additional hurdles.
- After the fullscreen request, browsers either show an additional passive message (mostly fine, but why all the hassle then, because this message can easily be missed by the user), or much much worse, show another message box which must be okay-ed by the user (yet another required user interaction). And the UX also seems to change all the time.
- And the absolutely worst offender: browsers hijack the Escape key to leave fullscreen mode, but since ancient times (at least since Doom?) the sacred Escape key is used to open the ingame menu.
- The whole asynchronous nature of the fullscreen API, but the above issues are more critical.
The pointerlock API has even worse issues, depending on browser. For instance I have demos where pointerlock should be activated when the mouse is pressed, and when the mouse is released, return to normal pointer mode (for instance because I want to manipulate an UI). This one for instance:
Chrome is doing the right thing, it is showing a little popup, and remembers to not show it again on the same page until the page is refreshed.
FF and Safari now also just show a passive popup (which is a big step forward from FF's previous UI where a button had to be pressed before the pointerlock would active. BUT the popup shows *every single time*. On Safari the whole page is shifted down for the popup :/
When fullscreen mode and pointerlock mode is combined, for some reason the message popup never disappears on Chrome...
Etc etc etc... it doesn't even make much sense to write tickets, because the behaviour of the user-feedback still keeps changing all the time.
I'm doing the only sane thing now and try to avoid the 'real' fullscreen mode, and instead simply use 'soft fullscreen' where the canvas is stretched over the available window client area (doesn't fix the pointerlock UX problems though).
Cheers :)
-Floh.