godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.23k stars 21.22k forks source link

Editor causes display to flash on and off when desktop is not extended under Windows 11 with multiple monitors connected #86585

Open 39digits opened 10 months ago

39digits commented 10 months ago

Tested versions

Issue exists on:

Issue does NOT occur on:

System information

Godot v4.2.1.stable - Windows 10.0.22621 (actually, Windows 11 Pro) - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.4633) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

I have 2 monitors connected to my desktop PC running Windows 11 Pro but I don't always use both. Under Windows 11 switch the Project setting from Extend to PC Screen Only to use only the primary display.

The editor causes my primary display to flash on and off when only 1 of my monitors are in use (i.e. Windows 11 is set to PC Screen Only instead of Extend for Project settings).

The issue only occurs on Godot 4.x and does not happen on 3.x

Steps to reproduce

Minimal reproduction project (MRP)

N/A

Calinou commented 10 months ago

Do you have variable refresh rate (G-Sync/FreeSync enabled)? Does the issue occur when VRR is disabled?

If the issue only occurs when VRR is enabled, try changing the VRR setting to only affect fullscreen applications in the NVIDIA Control Panel (as opposed to affecting both fullscreen and windowed applications).

If the issue still occurs even with VRR disabled, try enabling Update Continuously in the Editor Settings. This forces the editor to redraw every frame even if not necessary, which uses much more CPU/GPU resources but can avoid this kind of issue.

Also, can you reproduce this on a project that was created using the Compatibility rendering method? This uses OpenGL instead of Vulkan.

39digits commented 10 months ago

Thanks for the response, I can confirm the following:

The interesting part is that the issue only happens when I'm not using the second monitor which remains plugged into the desktop. The issue happens only if I set Windows Project to PC screen only (which effectively "turns off" the second monitor). If I switch it to Extend (thereby turning the second monitor back on) the issue never happens regardless of G-Sync setting or chosen Editor render method.

image
Calinou commented 10 months ago

Do your displays have different refresh rates? If so, this is a difficult situation for operating systems to manage. It's strongly recommended to have all displays running at the same refresh rate to avoid stuttering and other issues.

39digits commented 10 months ago

The second monitor is an older one and tops out at 60. My primary display was set to 144 (the issue occurs at this rate) but interestingly reducing the refresh rate to 120 (so a multiple of 60) seems to fix it.

I must admit I'm not sure why the issue only occurs when the second monitor is off. I would have thought the refresh rate of the second display would only be a factor if it was in use. When both are on and in use by the OS the primary can be on 144 and everything is fine. Do you know the reason why this is so? I'm purely curious.

Interestingly though, the Godot Editor is the only application that triggers this behaviour.

gloomie commented 9 months ago

This happens to me too. M28 144hz single monitor with nvidia gpu. Screen turns off and on every few seconds. Godot 4.2.1. Windows 11.

fire commented 9 months ago

I can confirm this as it happens to my monitor. https://www.dell.com/en-ca/shop/alienware-34-curved-qd-oled-gaming-monitor-aw3423dw/apd/210-bcye/monitors-monitor-accessories?dbp=1

Kemeros commented 8 months ago

I am able to reproduce this problem as well.

Windows 11 23H2 NVIDIA RTX 4070 TI Super with VRR enabled Driver version Problem stops completely if i disable VRR The Update continuously option helps but does not completely fix it Switching from PC screen only to extended has no impact on the issue for me