Windows task bar sometimes shows when switching to WINDOW_MODE_FULLSCREEN

Godot Version

4.2.2

Question

I have a switch in my project that calls DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN) to switch the app to non-exclusive full screen. Most of the time it works as intended, but sometimes the windows task bar shows up on top.

If feels like there’s some kind of environmental influence, cause every time I run the project it can be either of three cases, without changing anything in the project:

  • Never happens at all, no matter how often I switch back and forth between windowed and full screen.
  • Only happens the very first time when switching to full screen, then never again until I close the app and run it again.
  • Happens seemingly randomly every few tries.

Is there any way to control this behavior (without using exclusive full screen instead)?

Do you see the same behavior in other fullscreen applications?

Can’t say I remember ever seeing it in other applications, though I might have missed it if it happened like once or twice? But my Godot project it’s fairly frequent.

Experimenting a bit further, one suspicion I have is it might be somehow related to the window not getting properly focused unless I click on it with the mouse? Cause it never happens if I use mouse controls in the app or click on the window once before switching.

The problem could be that something is switching the focus to the toolbar. Like some kind of notification. Then the reason is Windows, not Godot.

This is the influence that needs to be eliminated.