Starting the game in Fullscreen mode affects the screen size when exiting fullscreen

Godot Version

4.3

Question

In “Project → Project Settings → Display → Window” are the Viewport Width and Viewport Height as well as Mode.
If the Mode is windowed, the game will open with a window the size of the viewport dimensions. If the mode is fullscreen, it opens in fullscreen. If you then enter windowed mode, the window will be the size of the monitor. My intuition was that it would be the size of the dimensions of the viewport as specified by the project settings.
Is this the intended behavior?
In order to achieve this effect I put a line of code of an object in the main scene that enters fullscreen in its _ready function. Is there a reason that the current behavior is used?

1 Like

I think this happens because when you start the game in fullscreen mode your game resolution changes to your monitor resolution. For exmaple the window size is 1280x720 in settings and when you start the game in fullscreen the windows size changes to 1920x1080. I’ll recomend you to resize the window when exiting fullscreen. P.S. your solution is right too if you mean that “too achieve this effect” is your solution

It’s resizeable by default, if you want to keep the viewport size the same regardless of window size you need to change your stretch mode.