godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.81k stars 20.14k forks source link

[BUG] Title bar hidden in windowed mode when viewport is higher than display resolution #95668

Open conde2 opened 3 weeks ago

conde2 commented 3 weeks ago

Tested versions

v4.3.stable.mono.official [77dcf97d8]

System information

Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Ti (NVIDIA; 31.0.15.3623) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)

Issue description

image

As you can see no title bar is shown when running the game:

image

Steps to reproduce

Set the window to something higher than your monitor screen resolution and see that the title bar is not displayed when the game is launch.

My display resolution is 1920x1080

My godot project: image

Minimal reproduction project (MRP)

test-screen-size.zip

AThousandShips commented 3 weeks ago

What would you suggest should happen instead? The window is set to launch on the center of the screen, should it:

conde2 commented 3 weeks ago

There are two problems at the current approach, of just centering. Best

  1. Currently the viewport is cut at the bottom because of the windows toolbar, making it display less content that is supposed to show.

  2. The window bordered title bar is not displayed

What I suggest is first consider the window title bar size, sums it up to the viewport size and then center it. (Your second option)

Also when centering and resizing consider the windows toolbar size.

There are the borderless option to anyone that wants to keep this current behaviour. But at the current state its not possible to have title bar in bigger viewport resolutions

AThousandShips commented 3 weeks ago

It is centered though? How would the bar be visible when the window is 260 pixels outside the screen to the top?

conde2 commented 3 weeks ago

It's covering the entire screen so I believe yes it's centered. I can't tell for sure.

So that's what I'm talking about, it should consider that extra size of the title bar when resizing.

Currently it already resizes to fit the screen and then centers it. But it uses the viewport size to calculate this, ignoring the title bar size.

AThousandShips commented 3 weeks ago

Thank you that's clearer! Can confirm that it resizes in that way, but would be relevant to discuss and document exactly how to handle that

conde2 commented 3 weeks ago

And where would that be better to do? In a proposal or in this issue?

Because I belive this is more a bug than anything else. Also could you confirm the bug? I'm not sure because there is no confirmed label.