Skip to content

Fix #2162 and #6477: Fullscreen-dependent functions not working in browsers #7538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

necaTecnico
Copy link

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.

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.
@necaTecnico necaTecnico requested a review from 4ian as a code owner April 7, 2025 10:23
@necaTecnico
Copy link
Author

Hey @4ian, can you please have a look?

@4ian
Copy link
Owner

4ian commented May 12, 2025

Hello! Thanks for taking the time to open this PR.

The main issue for me is that if this does not work, this will create more noise and complexity in the codebase :)
I appreciate the effort toward the tests, but they are heavily mocking stuff and so are not helping because the feature does not work.

I think we need to take a step back and understand:

  • what are the limitations forced on this API by browsers? According to the platform (web browser, Safari/Chrome, Electron, etc...)
  • can we workaround them?
  • how can we make something 100% bulletproof and that works in all/most cases.

@necaTecnico
Copy link
Author

necaTecnico commented May 16, 2025

Hi @4ian , thank you for reviewing this PR and sharing your concerns.

I completely understand the need to avoid adding complexity if it doesn't lead to a fully reliable solution. My intention here was to start solving the bug and start a discussion to get feedback on a potential direction to address the fullscreen detection issue fully (I have done all the code related to solving the bug, but something deeper is very wrong), which seems to be inconsistent across browsers.

As mentioned by @ClementPasteau earlier in #6477, opening a PR was necessary in order to move forward with a more productive back-and-forth discussion, so I worked with my professor to make that possible. I also wanted to follow up on the original discussion in #2162, which hasn't had any replies.

Thanks again, and I'm open to any suggestions on how to better approach this or align with what the project needs.

Best regards,
@necaTecnico

@necaTecnico necaTecnico mentioned this pull request May 21, 2025
1 task
@necaTecnico
Copy link
Author

Hi @ClementPasteau, think you can have a look please or leave some feedback, so we can continue our discussion? @jonasfj @Bouh also, if possible, I would like your input and feedback.

Thanks for your time, once again,
@necaTecnico

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants