Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Issues when toggling fullscreen #87
I'm trying to fix long-standing issues with fullscreen in my RenPyWeb port.
(Btw, I'm not doing anything with the "Fullscreen" button from the default shell.html, which seems not to play well with SDL2.)
I'm doing tests with a simple app (https://gist.github.com/Beuc/0ab96af2fde381dd40d818f6b13450c0) where 'F' toggles fullscreen at the SDL2 level (SDL_SetWindowFullscreen). Initial size is 800x600, my resolution is 1920x1080.
I need to investigate further (possibly with a GL app) but I wanted to share my initial results (wrong callback parameters, wrong size reset, concurrency issue(s?)).
On that particular point, it seems Esc. is directly handled by the browser in a basic way, while SDL_SetWindowFullscreen calls emscripten_exit_fullscren() which is responsible for calling the strategy exit callback explicitely.
OK, misread that and assumed that it was the other way around. I put some logging in the JS parts and it looks something like this:
Edit: Commenting out the if here makes both behave the same. (The callback gets called later in
(I wish I'd seen you edit earlier, sadly it wasn't there in my mailbox OTL
This fixes the canvas size, the "size changed" event size (and consequently the missing "resized" event) - though maintaining F pressed still produces a buggy result.
Do you want to file a bug against Emscripten, as restoreOldStyle looks like the proper place to call the callback?