Quick answer: Godot 4 toggling fullscreen returning to a smaller-than-expected windowed size? Viewport stretches to monitor resolution but window restores to original - explicit window size on toggle.
Player goes fullscreen on 4K monitor. Exits; window is 800x600 again.
Save window size pre-fullscreen
Snapshot Window.size; restore on exit fullscreen. Player's windowed config preserved.
Or set a sensible default
Pre-fullscreen window at 80% of monitor. Restore matches it.
Persist in user settings
Window size saved to config. Restore loads from config; fullscreen toggle is transparent.
“Window state and fullscreen state are independent. Manage both.”
Pure-fullscreen games can skip this. Windowed-or-fullscreen games need the saved state.