There was a flaw in the way that ProgramSettings was being used that meant there was a lot of reloading and saving going on which was unnecessary. Additionally there were some errors in the way that the Settings file was upgraded which mean that the old settings were keeping on getting overwritten. Fixes#104.
This DRS Support is just reserving a space for the future addition of DRS Settings pulled from the driver. This will allow the recording of settings listed in the 3D Settings within the NVIDIA Control panel.
Made some adjustments to when the MainForm is loaded, and how the NotifyIcon works for system tray.
Also Adjusted the way that the Windows Screens are computed so that we can reuse some of the code in AMD and NVIDIA screen generation so that the additional non-NVIDIA and non-AMD connected screens are still shown.
This will ensure that all screens show up in the images even if they aren't connected through an NVIDIA device. I also made the same changes to the AMD mode.
This is a subtle error, caused by either the NVIDIA driver being slow, or windows being slow in updating the location of the windows taskbar edge. This was causing an error in the GetNVIDIASCreenPositions function. Have added a 0.5 second delay to allow windows to update iit's display layout before we try to read it which should help, and also if we can't find the taskbar location in the settings, we just assume it is at the bottom. This should avoid exception.
Added specific checks to find and alert on 0 width or 0 height screens. This will then break other parts of the display layout.
Also moved the cloned screen check higher up to ensure we skip them properly.
Had some mistakes in the way that the profile graphics images were calculated on NVIDIA video cards. This meant that in some situations it calculated the image structures incorrectly, and didn't put the displays in the right places. This now changes that fact.
There is still an outstanding issue that the GetNVIDIAScreenPositions function still doesn't put the taskbar location in the right place yet. I need to fix that tomorrow.
There were some issues with memory deallocation where AllocateHGlobal memory was being freed incorrectly with FreeCoTaskMem. This was causing issues with subsequent memory allocations.
The Advanced Target Info object returned by the NVIDIA driver points to memory outside the allocated memory. I need to figure out how the NVIDIA code allocates the memory, so I can account for it on return.
I have been attempting to force Windows to refresh the notification tray using various Win32 API methods by sending messages to those notification tray windows to get them to refresh, but I haven't been able to get the right combination of setings. I am now leaving it for the next littlw while to concentrate on other issues.
Trying to get rid of any left over applications that DIsplayMagician had to kill the process of, so that the system tray is nice and tidy. Having some issues doing so.
There was a bug in the way that NVIDIA screen layouts were calculated. This error was due to a misunderstanding from me on how additional screens were listed within a mosaic config. Turns out additional screens are still recorded in the mosaic config, only just as 1x1 display grids. The screen finding logic now takes this into account.
Let's see if this works. It will skip grabbing the color data and the HDR data on monitors that don't support it. That includes the following connections types: VGA, COMPONENT, SVIDEO, DVI, COMPOSITE. Any other connection types will attempt to get HDR and Colour settings, so that we'll automatically support whatever new technology arrives in the future. Should help fix the last part of #76.
Finally managed to get taskbar positioning working perfectly. Also managed to add a 'Profile Tools' button which will allow the user to easily move the windows taskbar around the screen to different places. Please note that Windwows 11 taskbar only works at the top of the screen, or at the bottom. The taskbar will move to the left or right, but only the start button is shown :(. So I've disabled selecting left or right in Windows 11.
Partially through a different refactor to completely change how the taskbar settigns are stored, and the logic behind the application. Should make the taskbar more robust to apply.
Added some checks to temporarily pause any 'getconfig' type activities while we're changing the displayconfig. This should result in less config corruption, and fewer errors when there are timing edge cases.
We are able to patch the taskbar settings in DisplayProfiles without needing to get the users to remake their display proifiles. This changes the messaging to users.
This changes *should* be the last ones needed to get taskbar setting integrated. Fixes#78 (as much as we can fix it).
Works on Win 10, and partially on Win 11. Win11 won't update the main window until explorer.exe is restarted :(. There is talk that an upcoming Win 11 update will change that behaviour.
This change makes the ProfileRepository handle loading json config files from later versions of DM without causing an exception. This will mean that you can install later model config files and still have them work ok.
Used some of Soroush Falahati's amazing code, and now have the potential for storing the taskbar display layout. This unfortunately requires a display config change, so I will need to engineer some backwards compatibility.
The NVIDIA HDR colour logic was flawed, and wouldn't always apply properly. These logic changes now set the NVIDIA HDR colour back to windows controlled each time so the settings are at a known inital logical state. Then winlibray can set the windows HDR mode, and NVIDIA can set the NVIDIA HDR mode.
Found that I was combining Threads and Tasks together...never a good idea. Have moved fully over to a Task based model. Now still having issues with parallelism.
Improved the minimum form sizes for multiple forms to stop them looking bad.
Updated the DisplayMagician and DisplayMagicianShared assembly versions to v2.1.2.0 in preparation for release as the next version of DisplayMagician.
This version adds USB device support, and SuperDisplay detection (it is a way to use an Android Tablet as another windows display).
Also fixes cloned displays so that it uses the path priority rather than relying on HDR settings for mapping the cloned display ID to the real Display ID. This corrects some errors which occurred when some earlier screens didn't support HDR or the advanced Windows colour settings. It will now work in those situations.
Now supports multiple display adapters. Has been tested by @matthex with his 7 screens and 2 display adapters and works. Should fix#60 finally.
Also changed the way that cloned display configurations are patched. Was using the HDR structure previously as that contains a direct mapping, but of course it completely breaks if HDR information isn't supported by the monitor, or provided over the connection technology used. So the changes I made now use the display path priority order to figure out which cloned monitor belongs to which item.
Firstly, the UID's are pulled from the physical displays so that we have a list of them. We then go through the paths, and for each target we check if there is a matching physical UID. If there is NOT a matching physical ID, then it is a cloned display target. We store that for later.
Next, we go through the paths again, and we figure out which physical displays are NOT in use as display targets. When we have that list, we then map the left over physical displays to the cloned displays in path priority order.
Finally, we then go through each cloned display target in the paths array, and set it to the configuration that windows needs so it will make a cloned display. We also go through the modes array, and set the physical display id to the corresponding mapped physical UID we calculated earlier.
All of this results in Windows accepting the cloned display configuration as expected.
This corrects some errors with the WinLibrary and how it handles cloned displays.
Also removed the 0.5 second delay between the end of the NVIDIALibrary call, and the start of the WinLibrary one, because they do not appear to be needed based on the NVIDIALibrary testing we've been doing with NVIDIAInfo.
Also corrected some log entries and comments.
I *think* that NVIDIA Surround and AMD Eyefinity changes are so great that WinLibrary gets confused and gives up. NVIDIA Surround and AMD Eyefinity affects the windows display layout so much. This change adds a windows config refresh after the NVIDIA or AMD config is applied to make sure that the winLibrary calls are using the latest updated active config that results from the NVIDIALibrary and AMDLibrary config changes.
This version of WinLibrary improves handling of multiple display adapters to cope with multiple displays across multiple display adapters. Hopefully fixes#60 (but no guarantees yet)
Did a HUGE amount of testing with the amazing help of @domenic as part of #41, and we finally got the right configuration sorted out! This update is a reflection of the changes required.