godotengine / godotengine/godot

HTML5 Godot will not detect FullScreen if entered via browser/f11 request.

Open
#90,032 3 comments 1 reaction 0 assignees View on GitHub
bug platform:web topic:platforms
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

3.x

### System information

web (Chromium)

### Issue description

This behaviour mathes the one partialy described on https://stackoverflow.com/questions/27501409/exit-full-screen-using-f11-key-and-esc-key

What happen is, OS.window_fullscreen will only return True if godot itself asked for the fullscreen.

If user press f11 (when intercepted by brower, not captured inside godot), or go to hamburger menu and click fullscreen,
OS.window_fullscreen will not return true.

Indeed fullscreen godot shows ESC, and fullscreen browser shows F11;

this prevents good fullscreen behaviour management.

### Steps to reproduce

Acess [this](https://gdfsdb.pages.dev/) and enter fullscreen via input and via browser request.

### Minimal reproduction project (MRP)

A single label node with the script:

```
extends Label
func _process(delta):
text = str(OS.window_fullscreen)
func _input(event):
if !OS.window_fullscreen and event is InputEventMouseMotion == false:
OS.window_fullscreen = true
```

----

AND.

After entering via browser request one can RE-ENTER fullscreen, and detect true.

Then, one can EXIT 2 TIMES FULLSCREEEN.
The first time via ESC, now detection goes back to false, but viewport is still fullscreen
Then, using F11, one can really exit fullscreen.
OR
Diretly pressing f11 will exit "both" fullscreen at the same time.

----

Well, it seens that F11 put the BROWSER on fullscreen, and the engine request put the "page?".

So, maybe its 2 classes of fullscreen available. Idk.

Needs testing and a further investigation on apis.

Contributor guide

Open the contributing guide

Research direction

Start by running the linked MRP, which uses a Label script and OS.window_fullscreen, in Chromium and reproduce the F11, browser-menu, and in-engine fullscreen paths. Compare the reported property and exit behavior in each path; done means browser-entered fullscreen and its transitions are detected consistently, with relevant tests added if the existing test structure supports them.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript
Domain
web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.