Commit Graph

352 Commits

Author SHA1 Message Date
Terry MacDonald
a4198a103e Designer settings 2023-01-15 22:13:47 +13:00
Terry MacDonald
9ca168078d Updated EULA 2023-01-03 20:33:05 +13:00
Terry MacDonald
6add0822fb NVIDIALibrary Equality testing fix
This tweak fixes the equality testing so that it works reliably with rotated displays. It turns out that the NVIDIA driver doesn't set the TVFormat option reliably whenever it rotates a display. During testing I've had the TvFormat option set to 557 and 320 for the exact same nonitor, and it really seems to depend on what the driver decided it wanted to set (the landscape mode is always 555).

I expect that it is due to the portrait sizes not being 'standard' TV sizes, so it is trying to find the best match, but in any case the variation in this setting doesn't appear to affect us using the profile... it only affects the equality tests uses to check if a particular profile is in use.

For this reason I've excluded the TvFormat from the equality testing so that the variation caused by the driver doesn't break the Equals check.
2023-01-03 11:23:18 +13:00
Terry MacDonald
2b8eb93e8c Merge branch 'develop' of https://github.com/terrymacdonald/DisplayMagician into develop 2023-01-03 10:07:49 +13:00
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
dependabot[bot]
c73ca59532
Bump NLog from 5.1.0 to 5.1.1
Bumps [NLog](https://github.com/NLog/NLog) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-30 08:04:25 +00:00
Terry MacDonald
181b3b8a9a Added AMD display rotation awareness
Fixes #153. AMD display profiles with rotated displays will now show that rotation properly in the display layout. Last commit included NVIDIA and Windows, and this now means all supported video cards now have this feature so the issue can be closed.
2022-12-28 20:16:05 +13:00
Terry MacDonald
97664100e8 Added ability to show display rotation for NVIDIA and Windows
Added display rotation awareness to the Screen awareness parsing. This code is used to create the generic 'Screens' structures that are used to generate the display profile icons. This partially fixes #153. I still have to add the AMD configuration equivalent!
2022-12-27 21:40:52 +13:00
terrymacdonald
dea79f6dc8
Merge pull request #165 from terrymacdonald/dependabot/nuget/develop/NLog-5.1.0
Bump NLog from 5.0.5 to 5.1.0
2022-12-15 18:48:18 +13:00
dependabot[bot]
db863a129e
Bump Microsoft.CodeAnalysis.NetAnalyzers from 6.0.0 to 7.0.0
Bumps [Microsoft.CodeAnalysis.NetAnalyzers](https://github.com/dotnet/roslyn-analyzers) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/dotnet/roslyn-analyzers/releases)
- [Changelog](https://github.com/dotnet/roslyn-analyzers/blob/main/PostReleaseActivities.md)
- [Commits](https://github.com/dotnet/roslyn-analyzers/compare/6.0.0...7.0.0)

---
updated-dependencies:
- dependency-name: Microsoft.CodeAnalysis.NetAnalyzers
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-08 08:05:40 +00:00
dependabot[bot]
61e7428378
Bump NLog from 5.0.5 to 5.1.0
Bumps [NLog](https://github.com/NLog/NLog) from 5.0.5 to 5.1.0.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0.5...v5.1.0)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-29 08:05:28 +00:00
dependabot[bot]
8f7600d7b9
Bump Newtonsoft.Json from 13.0.1 to 13.0.2
Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 13.0.1 to 13.0.2.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-24 08:04:44 +00:00
Terry MacDonald
bc65a25a16 Tweaks 2022-11-06 19:54:23 +13:00
dependabot[bot]
a7e09d543a
Bump NLog from 5.0.4 to 5.0.5
Bumps [NLog](https://github.com/NLog/NLog) from 5.0.4 to 5.0.5.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0.4...v5.0.5)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 08:26:28 +00:00
dependabot[bot]
96a10547d5
Bump NLog from 5.0.2 to 5.0.4
Bumps [NLog](https://github.com/NLog/NLog) from 5.0.2 to 5.0.4.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0.2...v5.0.4)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-02 08:30:37 +00:00
terrymacdonald
304e369127
Merge pull request #137 from terrymacdonald/dependabot/nuget/develop/NLog-5.0.2
Bump NLog from 5.0.1 to 5.0.2
2022-08-21 20:42:19 +12:00
Terry MacDonald
392190ed18 Updated to new DisplayMagician Logo 2022-08-20 21:57:06 +12:00
dependabot[bot]
2e6bd7eda3
Bump NLog from 5.0.1 to 5.0.2
Bumps [NLog](https://github.com/NLog/NLog) from 5.0.1 to 5.0.2.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0.1...v5.0.2)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 08:25:40 +00:00
Terry MacDonald
8cc59583e1 Updated branch with latest develop hotfixes 2022-07-15 09:04:56 +12: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
cb51ea9245 Set all the JSON.net default values
We now properly set the default JSON values for everything except Display Profiles, which should avoid crashes to desktop if we miss setting a value from it's default in the future. This should help with application robustness.
2022-07-08 09:59:29 +12:00
Terry MacDonald
d719cecad2 Standardised JSON.net settings across modules
Just noticed that the Settings, Display Profiles and Game Shortcuts all had different json.net settings for reading and writing across all the modules. Have now standardised across them to make them act the same way.
2022-07-08 09:00:35 +12:00
Terry MacDonald
bd619a131e Merge branch 'develop' into feature-installed-programs 2022-07-03 20:07:57 +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
8122295716 Merged v2.4.0 release into branch 2022-07-01 14:04:27 +12:00
Terry MacDonald
20c390d6f9 Fixed ProcessPriority error in StartProgramControl
This is now working properly.
2022-06-29 20:37:20 +12:00
Terry MacDonald
e99db6d4af Updated NLog exception logging format to capture all details
Updated the NLog exception handling to make use of the additional logging options released recently. This will help provide me with more details when users create the Support ZIP File.
2022-06-28 13:47:56 +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
9827cfac9a Fixed excessive config gathering
The NVAPI and Windows APIs were checked multiple times in a row due to a logic error. THis has been partially corrected, but needs a lot of work to straighten it out.
2022-06-18 21:31:37 +12:00
Terry MacDonald
076f9524cd Remove unneeded NvAPI_Mosaic_GetSupportedTopoInfo function
This function isn't needed, but seems to be unreliable when it's used. So diabling it within NVIDIALibrary to reduce the chances of there being memory errors thrown.
2022-06-17 10:34:31 +12:00
Terry MacDonald
e893fbac69 Increased logging and improved uplay library processing 2022-06-17 10:18:55 +12:00
dependabot[bot]
8866334a8f
Bump NLog from 5.0.0 to 5.0.1
Bumps [NLog](https://github.com/NLog/NLog) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/NLog/NLog/releases)
- [Changelog](https://github.com/NLog/NLog/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/NLog/NLog/compare/v5.0...v5.0.1)

---
updated-dependencies:
- dependency-name: NLog
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-13 08:29:52 +00: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
d98730a9b2 Fixed exception in RemoveProfile function 2022-06-10 17:34:56 +12:00
Terry MacDonald
47912cf2e4 Updated TaskBarLayout and WinLibrary to latest versions 2022-06-10 17:29:58 +12:00
Terry MacDonald
7d17b5ae10 Fixed second CTD when changing from Surround to non-surround.
The NVIDIA Driver seems to not like any other SetTopoFlags except NONE. There is a CTD if anything is selected :(. So as a workaround I will leave send a NONE SetTopoFlag so DisplayMagician can work.

Also have updated the Display Profiles Window logic so that it repositions DisplayMagician in the center of the screen on the primary display. This has to be done when changing Display Profiles using the Apply Button, as the display coordinates change, and sometimes this results in the current position being off screen. This was causing confusion amongst users. But now just always moving to the middle of the primary screen I can always be sure that the UI is visible.
2022-06-09 22:56:07 +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
aee177ecb7 Added upgrading logic for Display Profiles to 2.4
DM will now warn users they will need to recreate their Display Profiles again. I really hope this is the last time I have to do this to my lovely users.
2022-06-03 21:43:30 +12:00
Terry MacDonald
6e82557ec6 Removed some uneeded variables from AMDLibrary 2022-06-02 20:18:02 +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
a318dc64f2 Adding WIndows DPI Scaling config patching for DisplayMagician
IMPORTANT: This patching means that DisplayMagician is able to use your existing Display Profiles, but there is a catch! DisplayMagician won't be able to detect that your old profiles are currently in use... in other words DisplayMagician will constantly think that you have a new Display Profile until you save a copy of the DisplayProfile again.

This occurs because DisplayMagician now gets and compares the NVIDIA 3D Settings and there is no way for us to figure out what previous 3D settings were in use when you set up previous display profiles. For that reason we'll just need you to save new Display Profiles.
2022-05-31 20:55:48 +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