Commit Graph

56 Commits

Author SHA1 Message Date
Terry MacDonald
f40863685c Modify tasbkarsettings to only get the useful settings
Also updated the code comments to describe the various values and what they mean.
2022-01-24 21:39:49 +13:00
Terry MacDonald
b6e0f83163 Working windows taskbar location tracking
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.
2022-01-23 22:45:02 +13:00
Terry MacDonald
918e3cda04 Initial working TaskBar position changes
Note - doesn't work n Windows 11.
2022-01-23 10:33:14 +13:00
Terry MacDonald
587814409a [WIP] Added in TaskBarSettings and restarting explorer 2022-01-22 15:35:25 +13:00
Terry MacDonald
f860b91a72 Enforced update to file format v2.2 2022-01-21 20:37:56 +13:00
Terry MacDonald
29b592a6d1 Initial attempt at recording taskbar location
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.
2022-01-19 22:02:57 +13:00
Terry MacDonald
b148d7484a Updated HDR colour setting logic
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.
2022-01-18 20:43:45 +13:00
Terry MacDonald
de1d93ee4d Updated WinLibrary to v1.3.8
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.
2021-12-16 12:25:11 +13:00
Terry MacDonald
22ae2bc178 Fixed multiple adapters and unsupported HDR parsing
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.
2021-12-12 09:23:24 +13:00
Terry MacDonald
9416ac3346 Updated WinLibrary to latest version
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.
2021-12-11 00:15:49 +13:00
Terry MacDonald
b34cdcce6c Updated to latest WinLibrary version
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)
2021-12-07 18:33:16 +13:00
Terry MacDonald
77ab0f20f1 Updated NVIDIA Library and WinLibrary based on testing
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.
2021-11-19 22:20:43 +13:00
Terry MacDonald
21d173b6ca Fixed mistake 2021-11-13 21:30:21 +13:00
Terry MacDonald
6f1721342f Updated NVIDIALibrary with the latest version
This version hopefully fixes the issues when returning from surround profiles to non-surround profiles.
2021-11-13 21:28:25 +13:00
Terry MacDonald
d4494aa699 Updated NVIDIA, AMD and Windows Video libraries
Updated with enhancements to make application of colour more robust, and to avoid a Windows CCD display validation issue.
2021-11-13 15:06:54 +13:00
Terry MacDonald
cc125b6601 Add an extra layer of library protection
Stopping unneeded AMD calls in NVIDIA mode, and NVIDIA calls in AMD mode.
2021-10-29 22:10:29 +13:00
Terry MacDonald
0b759ce378 Updated WinLibrary to latest version 2021-10-28 09:26:44 +13:00
Terry MacDonald
643daeae49 Loosened GDI matching a bit more 2021-10-26 21:26:23 +13:00
Terry MacDonald
d54328ceef Loosened GDI matching for updated GDI usage
As we now only copy across some of the GDI display settings, we aren't able to have really tight matching on the GDI part of the Windows display profiles. For this reason, I loosened off the Equals test so that it would match on the functions that we change within DisplayMagician. The profile matching now works correctly.
2021-10-25 19:18:46 +13:00
Terry MacDonald
c42b53843b Updated WinLibrary to use patched current Display Settings
This is needed to stop the GDI settings from overwriting the display layout. This appears to fix all display issues!
2021-10-25 16:01:33 +13:00
Terry MacDonald
1faa8ecc5b Updated AMDLibrary and WinLibrary to latest versions
AMDLibrary had an error that caused issues due to a missing call to get a valid default config. WinLibrary had an issue where it wasn't applying the GDIDisplaySettings correctly after a reboot. This has now been fixed.
2021-10-25 15:19:02 +13:00
Terry MacDonald
e321893876 Updated WinLibrary, AMDLibrary and NVIDIALibrary to v1.2.1
This integrates all the library enhancements that I've been working on for the last 2 weeks into DisplayMagician. This fixes $47, #46 and possibly others.
2021-10-24 21:06:59 +13:00
Terry MacDonald
76fba0d2ef Updated WinLibrary to support cloned displays 2021-10-23 15:24:32 +13:00
Terry MacDonald
816e1a701f Updated WinLibrary to latest version
Now supports cloned displays. Also modified a log entry from error to trace.
2021-10-20 18:06:02 +13:00
Terry MacDonald
81f2d08fe0 Fixed profile matching for cloned displays
Weird error where having a clone causes an extra 'zeroed out' entry in the Windows Display Modes sequence. This change modifies the Windows mode info checks to allow for this situation.
2021-10-17 10:44:03 +13:00
Terry MacDonald
dcde15e73b Working cloned display WinLibrary 2021-10-16 22:03:06 +13:00
Terry MacDonald
7661f1dc73 Made changes to stop Cloned displays causing CTD
Currently still can't get the cloned displays to get applied properly though. Looks like the cloned displays are not being recorded in the settings.
2021-10-16 21:41:34 +13:00
Terry MacDonald
cf1ff873ef Added patch to convert v2.0.1 displaySource to list
This should help avoid a crash to desktop when using cloned displays. Partially fixes #47
2021-10-16 16:45:49 +13:00
Terry MacDonald
4a8acd4b86 Updated WinLibrary with latest GDI API changes
This will hopefully fix the issues #45 and #46.
2021-10-15 10:01:21 +13:00
Terry MacDonald
e41279d706 Improved NVIDIALIbrary SetActiveOverride function
It now only applies configuration changes if they are needed to be applied. If the colour settings are the same then they aren't applied.
2021-10-09 19:58:22 +13:00
Terry MacDonald
a824f06b33 Updated DM will latest video libraries
Brought over all the latest working code from NVIDIAInfo, AMDInfo and CCDInfo. This includes the new split between the NVIDIA and AMD specific layout, and the NVIDIA and AMD specific color application, so that the video application logic goes like this:
1. Apply NVIDIA Surround or AMD Eyefinity and any 'pre' windows settings
2. Apply the Windows Display Layout
3. Apply the NVIDIA or AMD 'post' windows settings e.g. driver specific color overrides

This new process works.
2021-10-07 21:08:10 +13:00
Terry MacDonald
28a8f131b3 Workaround Windows changing display source order
Windows changes the display source order which mucks up the equality matching in DM. This change attempts to mitigate that fact.

There were also errors in the HDR settings captured, which indicate that the HDR changes weren't finishing before they were being recorded. This change attempts to take care of that too.

All tests so far seem to work, so lets see how things go!
2021-09-08 20:04:37 +12:00
Terry MacDonald
1966412162 Mostly working Equality part 3
Equality works until we return from a surround profile to a non-surround profile. At this point the displays are reordered by windows, and the windows display configus don't match any more. Addtionally, it looks as though we need a 0.5 second pause between applying the configuration, and reading the new config. There appears to be a difference between HDR before we changed to the surround proile and after we've returned, and that's not a good thing!
2021-09-08 11:00:00 +12:00
Terry MacDonald
f8e9eecf81 Removed derived ProfileItem classes
The derived ProfilteItem classes were an unnecessary distraction and wasted time I could be spending on other things. This set of changes are the first part of removing those derived classes and moving to a single ProfilItem class again, but with different configuration slots within it. Makes equality comparison SO MUCH EASIER!
2021-09-07 21:26:42 +12:00
Terry MacDonald
c59f236524 Still vainly trying to get Equals to work
I am a lot closer at the moment, but there is some bit of logic matching that is escaping me. I think I'm just too tired at the moment, and I need a sleep. I bet this will seem simple in the morning.
2021-09-06 22:08:22 +12:00
Terry MacDonald
7c21c19056 Fixed Profile Matching
Found an underlying problem of using the OutputID for displayIdentifier matching as the outputID changes after each reboot. CHanged the DisplayIdentifier to record the type of the connection to the display, which stays the same even if the OututID changes. Also made the ProfileItem.Equals look for DisplayIdentifier ids and match them even if they are in a different order. This seems to happen some times, and I'm not sure why the NVIDIA driver does it!
2021-09-05 21:00:36 +12:00
Terry MacDonald
708acd3c12 Fixed CompareTo and some Profile Repository loading order 2021-09-04 20:58:08 +12:00
Terry MacDonald
a112326e50 Implemented new derived class equality logic
Used new derived class equality class from https://codinghelmet.com/articles/equals-override which helped me understand the logic for deriving equality between base classes and derived classes. It has now exposed another error in the way FORCED_VIDEO_MODE is being applied and that is now something else I need to fix!
2021-09-04 16:32:42 +12:00
Terry MacDonald
964d982bd1 Fixed Video mode detection without forced parameter
Accidentally broke the auto detection when no forced video command line option given. Now works again.
2021-09-03 22:15:23 +12:00
Terry MacDonald
7772b27f89 Fixed error in comparison function 2021-09-02 14:52:46 +12:00
Terry MacDonald
cab056b7fd Updated the Equality and Comparable operators for ProfileItems
And in doing so, managed to break the Profile image logic!
2021-09-02 14:44:35 +12:00
Terry MacDonald
ee1d2e4717 Fixed screen drawing for icons and forms
Fixed the NVIDIA screen drawing so that it works fine now.
2021-09-01 22:13:22 +12:00
Terry MacDonald
b6bd89bed2 Updated NVIDIALibrary and WinLibrary based on NVIDIAInfo testing
Added in the ability to map the Windows CCD Display name to NVAPI DisplayId, which will make it possible to use that information within DisplayMagician.
2021-09-01 20:44:00 +12:00
Terry MacDonald
52d2f4f0f6 [WIP] Partially completed NVIDIA spannedScreens
Partway through having the Screens properly populated for the NVIDIA surround screen setups, but have struck an issue with the extra non-surround screens in a combined surround and non-surround screen setup. The additional non-surround screens don't have any X & Y positions set within the mosaic config, which means I should really be using the WIndows config details, but there isn't anyway to identify which windows screen path matches which nvidia display ID. THe only way to do this is to start storing the NVIDIA displayconfig too.
2021-09-01 14:30:33 +12:00
Terry MacDonald
bc6242a8bb Updated NVIDIALibrary and WinLibrary with latest versions.
Latest versions based on tests from NVIDIAInfo
2021-08-31 21:06:08 +12:00
Terry MacDonald
e2ca69e404 First working new NVIDIA library build!
Amazing! This is the first working version of DisplayMagician using the new NVIDIA and Windows CCD library. It works properly, and now I can start to tidy up some of the additioanl functionality I need to sort out before a release. I also then need to work on the AMD library as well!
2021-08-24 22:46:32 +12:00
Terry MacDonald
90c13c7426 Working profile comparisons 2021-08-24 20:37:32 +12:00
Terry MacDonald
5aad5003ac [WIP] First working save and load
Still have an issue where the 'Equals' doesn't detect that there is a different primary screen, so it won't let me save a new profile for the slightly changed display settings.
2021-08-22 21:57:29 +12:00
Terry MacDonald
ddbd6431c5 [WIP] Mostly working NVIDIAProfileItem
NVIDIA Profiles can be created, JSON file saved ok, and the bitmaps and icons are drawn correctly and showin in the Display Profile window. The problem comes when the DisplayProfiles_2.0.json file is loaded. JsonConvert causes an exception trying to populate ProfileBitmap, and I can't figure out why!
2021-08-22 21:45:51 +12:00
Terry MacDonald
508f3751b9 Fixed AMDProfileItem and WindProfileItem
DisplayMagician starts, but displayprofile form doesn't work at all.
2021-08-22 18:58:08 +12:00