-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Affects: HTML5 export.
Both fullscreen detection and fullscreen switch methods are broken when the user leaves fullscreen on Chrome/Windows via Esc key or on Chrome/Android via < button or on Safari/IOs via swipe down.
After executing the Activate fullscreen action, GDevelop thinks it is in fullscreen. Even if it is not, because fullscreen has been left manually. Then running Activate fullscreen again might crash. And worse, the condition The game is in fullscreen says true but it is not.
The Javascript code if (document.fullscreenElement != null) returns the correct value on all three browsers, no matter if the fullscreen has been closed via Activate fullscreen action or via the intended browser way.
Minimal project for reproduction:

Steps to reproduce
- Create a button and bind Activate fullscreen on click.
- Leave Fullscreen in the way your browser suggests.
- Check The game is in fullscreen or use the Activate fullscreen action again. Both don't work correctly.
- Check if (document.fullscreenElement != null). It does work.
GDevelop platform
Desktop
GDevelop version
5.3.195
Platform info
IDE: GDevelop via Microsoft Store on Windows 11
Browser: Chrome/Windows, Chrome/Android, Safari/IOs
Additional context
No response