Can't enter windowed mode when game resolution is the same as my screen
I switch to windowed mode using this:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
DisplayServer.window_set_size(Vector2i(1152, 648))
It works as expected. Except when the size of the game I put in the project settings is the same as my device resolution. Since my device is 1920x1080, then it won't work if I set the game resolution to 1920x1080.
Basically, when this code runs the window twitches a little but it stays in fullscreen mode. But if I set the resolution of the game to something like 1920x1079 then it will work.
I even tried setting the size before going in windowed mode, but that didn't work either:
DisplayServer.window_set_size(Vector2i(1152, 648))
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
Posted Nov 2, 2025, 5:55 PM UTC
210