Quick answer
A new Godot 4 project starts in a regular window. To launch in fullscreen, open Project → Project Settings and change the window mode:
That is enough for most games. If you want players to choose, leave the setting as Windowed and switch the mode from code, usually from an options menu.
Window modes
Godot 4 handles the window through the DisplayServer singleton. It offers five modes; four of them matter for games.
| Mode | Constant | Good for |
|---|---|---|
| Windowed | WINDOW_MODE_WINDOWED | Development, tools, casual games |
| Minimized | WINDOW_MODE_MINIMIZED | Rarely used in games |
| Maximized | WINDOW_MODE_MAXIMIZED | Apps that should keep the taskbar visible |
| Fullscreen | WINDOW_MODE_FULLSCREEN | The default choice for most games |
| Exclusive fullscreen | WINDOW_MODE_EXCLUSIVE_FULLSCREEN | Games that want the lowest possible latency |
Project settings
All window options live under Display › Window. Some of them only appear after you enable Advanced Settings in the top right corner of the Project Settings dialog.
Mode
Sets the mode the game starts in. Pick Fullscreen or Exclusive Fullscreen here if the game should never open in a window.
Borderless
Removes the title bar and frame in windowed mode. It has no effect once the game is fullscreen, so you do not need it for fullscreen support.
Viewport size
This is the base resolution your game is designed for, not the size of the window. In fullscreen the window always matches the monitor; the stretch settings below decide how the viewport is scaled to fit it.
Switching at runtime
Read and change the mode with DisplayServer.window_get_mode() and DisplayServer.window_set_mode():
func set_fullscreen(enabled: bool) -> void:
if enabled:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
else:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
func is_fullscreen() -> bool:
var mode := DisplayServer.window_get_mode()
return mode == DisplayServer.WINDOW_MODE_FULLSCREEN \
or mode == DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN
Save the player's choice to a ConfigFile in user:// and apply it in the _ready() of an autoload, so the game remembers it between launches.
F11 and Alt+Enter
Players expect a hotkey. Add an input action in Project Settings › Input Map, for example toggle_fullscreen, and bind F11 and Alt+Enter to it. Then handle it in an autoload:
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("toggle_fullscreen"):
set_fullscreen(not is_fullscreen())
get_viewport().set_input_as_handled()
Using _unhandled_input means a focused text field can still use the same keys without toggling the window.
Stretch and aspect
Without stretch settings, going fullscreen on a large monitor just shows your 1152×648 scene in the corner with empty space around it. Set these two options:
canvas_items scales the whole UI and 2D scene smoothly and suits most games. viewport renders at the base resolution and scales the result, which keeps pixel art crisp.
keep adds black bars when the screen's shape differs from yours. expand shows more of the world instead, which looks better on ultrawide monitors but requires a layout that tolerates it.
For pixel art, also set display/window/stretch/scale_mode to integer so pixels are never stretched by fractional amounts.
Platform notes
Windows
Regular fullscreen is a borderless window covering the monitor, so Alt+Tab and overlays behave well. Exclusive fullscreen hands the display to the game and can reduce input latency, but switching away can briefly blank the screen, depending on the graphics driver.
macOS
Fullscreen moves the game into its own Space, like any native app. In exclusive mode the Dock and menu bar stay hidden when the pointer touches the screen edge, which is usually what a game wants.
Linux
Behaviour depends on the window manager and on X11 versus Wayland. Test on at least one of each if you ship on Linux.
Web
Browsers only allow fullscreen in response to a click or key press. Call window_set_mode() from an input handler or a button's pressed signal; calling it from _ready() will be refused.
DisplayServer.window_set_current_screen() before switching modes.Coming from Godot 3
Godot 3 used OS.window_fullscreen = true. In Godot 4 that property no longer exists; window handling moved from OS to DisplayServer. The project setting also changed: the old Fullscreen checkbox became the Mode dropdown described above.
Troubleshooting
The game opens windowed even though I set Fullscreen
Check whether a script calls window_set_mode() on startup, for example when loading saved settings, and overrides the project setting. Also make sure you edited the setting on the right feature tag, not only for one export preset.
Nothing happens when I run from the editor
Recent editor versions can embed the running game inside the editor, where window mode changes may be ignored. Switch the game to run in a separate window, or test the exported build.
The picture is small or blurry in fullscreen
Revisit the stretch settings. A small image means stretch mode is disabled; blurry pixel art means the scale mode should be integer and textures should use nearest filtering.
Quick test from the command line
Launch any project with --fullscreen (or -f) to force fullscreen without touching the settings.