Commit Graph

102 Commits

Author SHA1 Message Date
Terry MacDonald
c641bce5a1 Removed delay from taskbar location monitoring
The taskbar location detection process was taking way too long when clicking on the 'view current display' button on the display window. Do I have had to disable the taskbar location detection logic for now until I can work out  way of doing it without waiting for registry changes (as it is done now). This was required in order to be able to detect the taskbar location registry settings so that we could store them to use them later.

This taskbar registry detection doesn't work at present as it is highly unreliable, and it delays the user experience for the other 99% of the time. Its just not worth the effort right now, so parking this for now.

To temporarily disable this being used, I've simply forced the WindowsLibrary fastscan mode to be enabled (fastscan being on means it won't do taskbar location scanning).
2023-01-03 10:07:41 +13:00
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
Terry MacDonald
83b8938e1a Reduces config scanning delay as much as possible
WinLibrary currently waits 5 seconds if it can't read the taskbar registry, and then it tries again. This is because based on my testing, if a screen layout changes, windows takes up to 20 seconds to update registry to record this fact. We have to wait until windows has finished 4 times before we are sure to have passed the 20 second window.

This is likely the delay you have mentioned. I *think* that I can slightly speed this up. We only MUST to do this delay when we are recording the config (i.e. creating a new display profile), and other times it's kind of a nice to have. So I've attempted to speed this up using a 'fastScan' option for the WinLibrary GetActiveConfig function. This will enable it to only query once for the general scans of the active config, and if there is a problem getting the data it will just accept that fact and will still return quickly. But it will still take up to 20 seconds when creating a new display profile as it is REALLY important we get that data correctly.

Fixes #129
2022-07-02 15:08:54 +12:00
Terry MacDonald
5cb653f449 Remove uneeded DPI_VALUES array
Had forgotten to remove the uneeded DPI_VALUES array. This would have crashed the WinLibrary SetDisplayConfig process.
2022-06-28 11:43:18 +12:00
Terry MacDonald
2e18ca1832 Change to work with the new DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED option
This change means that DisplayMagician only supports Windows 10 (version 1809 or later), or Windows 11. This fixes issue #123.
2022-06-28 11:39:14 +12:00
Terry MacDonald
01d6c1b9a9 First attempt at setting Process DPI Awareness
This is required so that the undocumented DISPLAYCONFIG_SOURCE_DPI_SCALE_GET Windows CCD call is given the correct information by Windows 10/11. It gives an abnormal number on some hardware if this is not set. What we do now is set the process DPI context to "System Aware" on boot, but when we are either getting or setting the Windows DPI settings, we quickly swap to "Monitor Aware v2" DPI context, before swapping back to "System Aware" when we're done. This *should* return the correct per monitor settings.
2022-06-28 09:29:18 +12:00
Terry MacDonald
e893fbac69 Increased logging and improved uplay library processing 2022-06-17 10:18:55 +12:00
Terry MacDonald
2d2cbcbe90 Updated WInLibrary and TaskBarLayout to latest versions
This change adds validation and additional checks to TaskBarLayout. Adds some extra logging to WinLibrary.
2022-06-12 22:04:05 +12:00
Terry MacDonald
cb43f74629 Fixed potential bug with window taskbar location during screen generation
There is a possibility that there are two displays with the same UID. This happens with software created displays such as SpaceDesk and Superdisplay. This means that we need to try and figure out which screen is the right screen, and then when we know which screen we were really wanting to
2022-06-10 18:52:26 +12:00
Terry MacDonald
47912cf2e4 Updated TaskBarLayout and WinLibrary to latest versions 2022-06-10 17:29:58 +12:00
Terry MacDonald
97d9caf2af Fixed CTD in patchAdapterids
Error with PatchAdapterIds that caused a crash to desktop. Has now been fixed. Should fix #117 and #118
2022-06-09 22:25:37 +12:00
Terry MacDonald
dab58a5a2b Updated WinLibrary to the latest version.
Fixes #114
2022-06-04 09:52:27 +12:00
Terry MacDonald
aede23a83d Updated NVIDIALibrary and WinLibrary to handle win display reordering
NVIDIALibrary and WinLibrary were too rigid in their equality testing, which meant that there was a problem when Windows reordered the displays in the path. This happens randomly when changing to cloned displays, and after a reboot. This would muck up the equality testing, which would prevent users selecting the display profiles. This has now been corrected (as far as we can tell so far).

There is a slight chance that further testing may find other parts of the Windows Display Config that randomly change and need to be updated. Thanks Microsoft.
2022-06-03 21:47:33 +12:00
Terry MacDonald
3fba28087c Made TaskBarLayout creation more robust
TaskBarLayout now catches exceptions recording the taskbar location and handles them properly. It will skip any screenss that it cannot access the taskbar information for. The Screen layout generator for NVIDIA, AMD and Windows have all been updated to handle having no taskbar layout information (it just assumes the taskbar is down the bottom of the screen).

Hopefully fixes #114
2022-06-02 19:51:07 +12:00
Terry MacDonald
56c2410d85 Updated WinLibrary so it patches adapter IDs accurately
This was a major error that somehow slipped through previous work. WinLibrary was only partially patching the Windows Display Config when it was being loaded, and that resulted in some parts  of the Windows Display Config not working after a windows reboot. This should now be fixed!

Fixes #103
2022-06-02 18:14:51 +12:00
Terry MacDonald
340387dcc4 Updated WinLibrary, NVIDIALibrary and AMDLIbrary to latest versions
Updated video libraries to v1.7.5
2022-05-31 09:02:18 +12:00
Terry MacDonald
a93c9e62d2 Added Windows per source DPI scaling settings 2022-05-30 10:01:43 +12:00
Terry MacDonald
f40640ccbd Updated UpdateActiveConfig 2022-05-29 21:16:55 +12:00
Terry MacDonald
567c9b7af2 Reduced the displayid calls for profile comparison 2022-05-29 21:01:08 +12:00
Terry MacDonald
b7194dd6e9 Added extra logging 2022-04-19 09:51:35 +12:00
Terry MacDonald
f042622921 Added SpaceDesk to recognised PCI devices
Also improved logging around PatchAdapterIDs
2022-04-19 09:31:07 +12:00
Terry MacDonald
7bb96956f1 Fixed merge errors 2022-03-30 10:56:24 +13:00
Terry MacDonald
168fab9fc2 Merge from feature branch 2022-03-30 10:49:10 +13:00
Terry MacDonald
37b9a79ff2 [WIP] Partial integration of new libraries.
Still some bits broken.
2022-03-25 21:51:38 +13:00
Terry MacDonald
842854e957 Merged from feature-update-libraries 2022-03-24 22:41:16 +13:00
Terry MacDonald
67c1015730 Updated the NVIDIALibrary and WinLibrary to v1.7.0
This is the version used within NVIDIAInfo v1.7.0
2022-03-24 22:36:42 +13:00
Terry MacDonald
72b1acfe46 [WIP] Attempt to get TaskBar changing to work 2022-03-05 18:46:47 +13:00
Terry MacDonald
87f62aa322 Made display changes reliable 2022-02-12 09:18:03 +13:00
Terry MacDonald
1f6af1f0c7 Working taskbar refresh after stopping programs
Moved the refreshnotificationarea logic to only be used when needed.
2022-02-07 15:18:30 +13:00
Terry MacDonald
b65d42e3ea Working taskbar notification tray refresh 2022-02-07 15:01:59 +13:00
Terry MacDonald
093663bb1c Reverted attempts to get notification tray refresh
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.
2022-02-07 14:43:20 +13:00
Terry MacDonald
2e52e3ceb1 [WIP] Attempt to refresh Taskbar SystemTary and Overflow Notification Window
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.
2022-02-06 21:54:00 +13:00
Terry MacDonald
4f64537d89 Update AMDLibrary and WinLibrary to skip HDR if connector doesn't support it
This works for WinLibrary and *should* work for AMDLibrary, but I don't have an AMD video card to test it with :(.
2022-02-06 15:33:15 +13:00
Terry MacDonald
81b565dfa6 Fixed taskbar move in profiletools 2022-02-05 21:28:51 +13:00
Terry MacDonald
3aa07257b8 Working Taskbar positioning
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.
2022-02-04 21:30:52 +13:00
Terry MacDonald
3e150cc28b Success moving main taskbar without explorer restart
Woo hoo! I managed to make the main taskbar move by sending a custom message I found that Windows 10 sends to the main taskbar.
2022-02-04 17:37:52 +13:00
Terry MacDonald
c45e66275a [WIP] Removing manual setting of taskbar location in DM
The idea should be to make the changes directly to windows, and DisplayMagician will set things up the same as it recorded you'd set.
2022-02-03 09:20:06 +13:00
Terry MacDonald
3b34d6943d [WIP] Fixed taskbar ProfileSettingsFOrm 2022-02-02 21:59:00 +13:00
Terry MacDonald
a13aa60258 [WIP] TaskBar changes 2022-02-02 11:44:13 +13:00
Terry MacDonald
c9a349125d [WIP] Added forcing taskbar edge ability 2022-02-02 11:25:11 +13:00
Terry MacDonald
f6e5dbc0b7 [WIP] Refactor for taskbar code
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.
2022-02-01 22:04:08 +13:00
Terry MacDonald
cd25f9a0fa [WIP] Partially working taskbar moving 2022-01-30 20:24:36 +13:00
Terry MacDonald
76ec3d6426 Fixed bug in TaskBar processing when ni edge available 2022-01-29 14:55:24 +13:00
Terry MacDonald
b12815dcff Fixed mistaken file copy 2022-01-28 17:18:20 +13:00
Terry MacDonald
7d0c8e1ca4 Updated NVIDIALibrary and WinLibrary to latest version 2022-01-28 17:04:42 +13:00
Terry MacDonald
be30996020 Changed the message shown to users to remove recreate message
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).
2022-01-25 09:28:13 +13:00
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