Hello @Eferinte 林 ,
Based on your description, this automatic switching behavior doesn't appear to be an intentional "built-in logic" of Windows 11 itself. Instead, it might be a side effect of how the Windows Connecting and Configuring Displays (CCD) mechanism handles display topology caching, or perhaps how the specific parsec-vdd wrapper interacts with the OS.
Since you reached out in the Win32 API section, I would like to suggest a couple of approaches you could try to resolve or work around this issue:
1. Try Clearing the Display Topology Cache (Registry) Sometimes, Windows might hold onto a corrupted display profile cache. Resetting it could force Windows to "forget" the previous layouts and relearn your intended setup.
- Open Registry Editor (
regedit). - Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers - You can try backing up and then deleting the following three subkeys (Windows should recreate them automatically upon restart):
-
Configuration -
Connectivity -
ScaleFactors
-
- Restart your PC. After rebooting, try manually setting your physical display (2560x1440) as the primary monitor before adding your virtual displays again, and see if Windows saves the correct topology this time.
2. Exploring a Programmatic Workaround (Win32 API) If clearing the registry cache doesn't resolve the behavior, you might consider writing a small background service or script to intercept and adjust the layout automatically:
- You could listen for the
WM_DISPLAYCHANGEmessage. This is broadcasted to all windows when the display resolution or topology changes. - Upon receiving this message, you might use
EnumDisplayDevicesto iterate and locate your physical monitor. - Then, calling
ChangeDisplaySettingsExwith theCDS_SET_PRIMARYflag targeting your physical monitor's device name could potentially force it back to being the primary output.
Hopefully, these suggestions help. If you found my response helpful or informative, please follow this guide to provide feedback.
Thank you.