Advertisement

Second monitor woes.

Started by September 06, 2019 05:19 PM
1 comment, last by tanzanite7 5 years ago

Changing screen resolution on primary screen causes a few undesirable effects on the second (Nvidia GPU + Windows 7, don't know how it behaves on any other OS):

1. None of the third party windows there will properly repaint themselves at any screen resolution change event and get garbled. A few affected examples: Windows task manager, Firefox and Visual studio. Besides VS i would expect thous third party programs to be, in relevant areas, error free or sufficiently close to it - so, i have only Windows, Nvidia and myself left to blame. Not terribly helpful.

2. Second monitor contents will be displaced (in my setup the second monitor extends the desktop after the first - hence the displacement makes sense from the OS point of view, but is detrimental nonsense in my context).

Context: screen resolution change is for Vulkan rendering in fullscreen window.

Screen resolution is changed first (with CDS_FULLSCREEN as its flags parameter). Then the window (WS_POPUP|WS_CLIPSIBLINGS|WS_CLIPCHILDREN) covering the full screen area.

Given that - i do not see how i could communicate my intent for the OS and prevent the displacement. I have seen plenty programs that fail in the same manner, but have seen a few that do not - so, there likely is an solution. It could be that this is a Vulkan specific problem (DX, i am fairly sure, can just directly express the intent to the OS - aka. ask for "exclusive mode"). Cannot easily test it currently, but could this work: retrieve second monitor desktop coordinates - change primary monitor - set the second monitor desktop coordinates back? Or is there a way to prevent the OS from mucking with the second monitor to begin with (which would likely fix both of the problems)?

Problem nr 1 - i have no idea what to do about.

edit: Noticed that several months ago VK_EXT_full_screen_exclusive popped up. However it seems to just allow explicit allow/disallow of switching to exclusive mode. Nvidia switches to exclusive mode by default - which causes some of the screen resolution change behaviors (even if already was at the desired resolution). I suspect that switching it off would prevent or help with second monitor garbling (ie. i suspect Nvidia drivers are at least partly to blame). However, support for this extension is currently nearly non-existent (via vulkan gpuinfo page). So, cannot even test that.

Minor update: watching/testing the screen resolution change a few times i can now say with certainty - screen garbling is caused by the exclusive mode switch. I can never see any garbling after the first screen flickering (actual screen resolution change) and if i never actually fulfill the auto exclusive mode conditions when creating the window then the second flicker won't happen either and nothing will be garbled. If i do fulfill the exclusive mode conditions and get the switch and accompanying flicker - i get the garbling after it is done.

Darn Nvidia/Windows. So, it seems there is nothing i can do - besides adding support, someday in the distant future, for the mentioned extension to allow uses to explicitly disallow exclusive mode.

This topic is closed to new replies.

Advertisement