DisplayMagician/DisplayMagicianShared
Terry MacDonald eefa361773 Fixed error when returning from Mosaic layouts in WIndows 10
There was an error that occurred in NvAPI_SetDisplayConfig when attempting to go from an NVIDIA Surround to a non-NVIDIA Surround setup on a machine that has multiple video cards installed in it. This is due to the fact that the NVIDIA driver only sees the displays connected to NVIDIA video adapters.

The previous DM logic tried to set the DisplayConfig after switching to or from a Surround display profile, but this would fail when returning from a a Surround display profile on Win 10 devices. It appears that the NVIDIA driver AUTOMATICALLY disables all additional displays in windows when it returns from a Surround profile. This simple fact means that the DisplayConfig won't be applied properly, and it errors with an NVAPI_INVALID_ARGUMENT error. This doesn't actually matter though, as the WinLibrary comes to the rescue.

WinLibrary can see all the video adapters available, and so will turn the required displays back on and set them up just right! We *may* lose are some specific DisplayConfig parameters abeing set as part of this process, but I'm not totally sure about that as WinLibrary is basically feature parity with the DisplayConfig settings as far as I can tell.

The fix is to look specifically for the NVAPI_INVALID_ARGUMENT error when attempting to set the NvAPI_DisplayConfig, and if this happens we check if we were going from a surround profile to a non-surround profile. If that is true, then we simply ignore that error. WinLibrary then clears up that problem and everything proceeds as normal.

This should (fingers crossed) fix #119!

This change also makes it far faster to grab and set the tabaskbar settings from registry, though this logic may not detect some Windows 10 formats which appear to be LOCALDISPLAY(\d,\d,\d\d) settings which I've never seen before. It should be generally much faster and more reliable.
2022-07-14 22:41:59 +12:00
..
AMD Removed some uneeded variables from AMDLibrary 2022-06-02 20:18:02 +12:00
NVIDIA Fixed error when returning from Mosaic layouts in WIndows 10 2022-07-14 22:41:59 +12:00
Properties Fixed Desktop right-click menu 2022-04-15 11:46:46 +12:00
Resources [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
UserControls [WIP] Partial integration of new libraries. 2022-03-25 21:51:38 +13:00
Windows Fixed error when returning from Mosaic layouts in WIndows 10 2022-07-14 22:41:59 +12:00
DisplayMagicianShared.csproj Bump NLog from 5.0.0 to 5.0.1 2022-06-13 08:29:52 +00:00
DisplayMagicianStartupAction.cs [WIP] Partial integration of new libraries. 2022-03-25 21:51:38 +13:00
PixelShift.cs [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
ProfileIcon.cs Revamped display layout image shortcut generation 2022-04-19 21:12:00 +12:00
ProfileItem.cs Fixed error when returning from Mosaic layouts in WIndows 10 2022-07-14 22:41:59 +12:00
ProfileRepository.cs Reduces config scanning delay as much as possible 2022-07-02 15:08:54 +12:00
ResizeDrawing.cs [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
RestartManagerSession.cs [WIP] Partially working taskbar moving 2022-01-30 20:24:36 +13:00
Rotation.cs [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
Scaling.cs [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
ScanLineOrdering.cs [WIP] First working WiX installer 2020-12-20 20:42:04 +13:00
SharedLogger.cs Library include cleanup 2021-02-21 20:23:41 +13:00
ShellHelper.cs Made display changes reliable 2022-02-12 09:18:03 +13:00
Utils.cs Updated the NVIDIALibrary and WinLibrary to v1.7.0 2022-03-24 22:36:42 +13:00
Wallpaper.cs First working display background per profile 2021-09-02 10:42:26 +12:00