Fixed inconsistent NVIDIA HDR display setting

THere was an unneeded check that prevented the NVIDIA HDR settings being applied when it should have been. This in turn meant that the display profile equality matching wasn't working as the applied display profile was sufficiently different to the one selected and applied that it wouldn't match, and would instead display the brand new profile interface. This has been corrected now.
This commit is contained in:
Terry MacDonald 2021-09-09 09:21:53 +12:00
parent 28a8f131b3
commit 6bd9898ea8
2 changed files with 31 additions and 35 deletions

View File

@ -56,8 +56,8 @@ namespace DisplayMagician.UIForms
// Apply the Profile // Apply the Profile
if (ProfileRepository.ApplyProfile(_selectedProfile) == ApplyProfileResult.Successful) if (ProfileRepository.ApplyProfile(_selectedProfile) == ApplyProfileResult.Successful)
{ {
/*logger.Error($"DisplayProfileForm/Apply_Click: Waiting 0.5 sec for the display to apply"); logger.Error($"DisplayProfileForm/Apply_Click: Waiting 0.5 sec for the display to apply");
System.Threading.Thread.Sleep(500);*/ System.Threading.Thread.Sleep(500);
ChangeSelectedProfile(_selectedProfile); ChangeSelectedProfile(_selectedProfile);
} }
} }

View File

@ -1249,9 +1249,6 @@ namespace DisplayMagicianShared.NVIDIA
// Now, we have the current HDR settings, and the existing HDR settings, so we go through and we attempt to set each display color settings // Now, we have the current HDR settings, and the existing HDR settings, so we go through and we attempt to set each display color settings
foreach (var wantedHdrColorData in displayConfig.HdrConfig.HdrColorData) foreach (var wantedHdrColorData in displayConfig.HdrConfig.HdrColorData)
{
// If we have HDR settings stored for the display, then attempt to set them
if (currentDisplayConfig.HdrConfig.HdrColorData.ContainsKey(wantedHdrColorData.Key))
{ {
// Now we set the HDR colour settings of the display // Now we set the HDR colour settings of the display
NV_HDR_COLOR_DATA_V2 hdrColorData = wantedHdrColorData.Value; NV_HDR_COLOR_DATA_V2 hdrColorData = wantedHdrColorData.Value;
@ -1285,7 +1282,6 @@ namespace DisplayMagicianShared.NVIDIA
SharedLogger.logger.Trace($"NVIDIALibrary/SetActiveConfig: Some non standard error occurred while getting Mosaic Topology! NvAPI_Disp_HdrColorControl() returned error code {NVStatus}. It's most likely that your monitor {wantedHdrColorData.Key} doesn't support HDR."); SharedLogger.logger.Trace($"NVIDIALibrary/SetActiveConfig: Some non standard error occurred while getting Mosaic Topology! NvAPI_Disp_HdrColorControl() returned error code {NVStatus}. It's most likely that your monitor {wantedHdrColorData.Key} doesn't support HDR.");
} }
} }
}
} }
else else