Going from fullscreen to windowed mode leaves the taskbar out of screen

Hello!
I have a fullscreen toggle button and the following code is executed when it’s pressed.

func toggle_fullscreen(value):
	DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN if (value) else DisplayServer.WINDOW_MODE_WINDOWED)
	game_data["fullscreen_on"] = value
	save_data()

But the problem is that when the game is set to windowed mode, the taskbar of the window gets stuck out of screen and you have to move it with something like alt+enter.
How can i prevent this? Maybe an extra code to fit the window into the screen after switching to windowed mode, but that seems kind of annoying for the user.

1 Like

Hey there! I might not know what the solution, But always make sure to run Godot with terminal(PowerShell, Bash, etc.) when there’s system and rendering related issues

It might be a bug, and you can save a lot of lives by reporting it as quick as you can, Cheers! <3

1 Like

I was tampering with project settings and i think this is a bug but i don’t know how to reproduce it, it SEEMS to be fixed.

What i did was change “Display > Window > Mode” between Window, Exclusive Fullscreen and Fullscreen back and forth a few times.

I’ll just let this stay here for a while if i have any updates on the matter or if anyone has any ideas.

1 Like

Seems like a bug to me, if you mean you’re doing this in the editor, It’s probably a bug and i advice to run Godot with the terminal if it occurs multiple times.

Or if you’re doing this in code (while the game is running) you should probably check if you can use call_deffered() with whatever functions you’re calling, Since call_deffered() makes sure that the all the code has been executed before running the chosen function, Let’s just say it prevents a lot of bugs!