How to fix window getting stuck in Fullscreen after changing window mode

Godot Version

4.2

Question

So I have this problem where every time if I change the window mode to Maximize and then to Fullscreen and then to Windowed the window stays stuck in Fullscreen. So far I haven’t been able to find a fix for this because all im doing is running the “DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)” lines for each appropiate window mode but its still stuck in fullscreen every time I choose the Windowed option.

I can still go to the maximized option and it works as intended but the Windowed option will only display the fullscreen option.

Hi!

Could you share your code, so that we could try running it and see if it works on our side? Also, maybe consider updating your Godot version to 4.3 or 4.4, as this may be a version related bug (even if you’re not considering updating the engine for the rest of your development, but at least for debugging purpose).

Hi yes here is the code. I am using an options button to select each window mode. I’ll see about updating Godot to the newer and see if that fixes the issue.

I am not doing anything complicated but just changing the window mode

func _on_option_button_item_selected(index):
	match index:
		0:
			DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)
		1:
			DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_MAXIMIZED)
		2:
			DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)

Indeed, nothing weird in your function.
Let us know once you’ve updated the version!

I updated the engine and yes it is indeed an engine bug that was fixed because it doesnt happen the newest version of Godot

1 Like