Fix #2162 and #6477: Fullscreen-dependent functions not working in browsers #7538
+404
−35
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An application or game developed on this platform, with a function depending on fullscreen mode, does not work. This includes entering or leaving fullscreen via the keyboard or the top buttons of the browser bar.
The RuntimeGamePixiRenderer in GDevelop had trouble detecting fullscreen changes in browsers, especially Chrome. While it worked fine in Electron, browsers struggled with detecting fullscreen state changes and updating UI elements properly.
The fix involved adding support for all browser-specific fullscreen events (fullscreen, webkit, moz) and ensuring the canvas resizes correctly when fullscreen changes. A test suite was created in newIDE/app/src/Utils/runtimegame-pixi-renderer.spec.js to verify these changes, including tests for different browsers and a failing test to ensure the suite works as expected.
Even though all tests pass and the code follows best practices, something is still not quite right when running in actual browsers. This suggests there might be browser-specific quirks or timing issues we haven't caught yet. The foundation is solid, but we may need to investigate deeper into browser behaviors to achieve perfect results An application or game developed on this platform, with a function depending on fullscreen mode, does not work. This includes entering or leaving fullscreen via the keyboard or the top buttons of the browser bar.
Given our last discussions and what I have coded and mentioned here, any suggestions on fixing this in a different way or something out of my hands which is missing, or something wrong? It is still not solving the bug, even though it seems to have the correct code. @ClementPasteau @Bouh @jonasfj I have managed with my professor to open a PR.