Screen turns black when I go to fullscreen

Godot Version

4

Question

About a month ago I added a button to make my game fullscreen, that would just
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) and everything worked. But as of recently, whenever I try to do that my screen just turns black as soon as it goes fullscreen.

Did you try exclusive full screen? And what engine version are you using? Have you changed versions between now and the last time it worked?

Also, does fullscreen work in a blank project/other projects?

I ended up testing it in a different project and realized what was causing the issue was setting stretch mode to “viewport”. Setting it to “Canvas items” fixes it but now I’m running into an issue where I have a one pixel grey border around the screen when fullscreened

This is a bug cause by non exclusive fullscreen mode. I’ve not found a solution for this as of yet, but I do get around by using:
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN)