From 69eb0c289f6c889c726aec37e92c1f8286a8f7dd Mon Sep 17 00:00:00 2001 From: Serge <5920850+seerge@users.noreply.github.com> Date: Tue, 26 Mar 2024 23:18:53 +0100 Subject: [PATCH] Skip Visual Mode command if HDR is ON --- app/Display/ScreenCCD.cs | 4 ++-- app/Display/VisualControl.cs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Display/ScreenCCD.cs b/app/Display/ScreenCCD.cs index c979bef6..f1ab8e82 100644 --- a/app/Display/ScreenCCD.cs +++ b/app/Display/ScreenCCD.cs @@ -6,7 +6,7 @@ namespace GHelper.Display public class ScreenCCD { - public static bool GetHDRStatus() + public static bool GetHDRStatus(bool log = false) { var err = GetDisplayConfigBufferSizes(QDC.QDC_ONLY_ACTIVE_PATHS, out var pathCount, out var modeCount); if (err != 0) @@ -46,7 +46,7 @@ namespace GHelper.Display info.outputTechnology == DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY.DISPLAYCONFIG_OUTPUT_TECHNOLOGY_DISPLAYPORT_EMBEDDED || info.monitorFriendlyDeviceName == internalName) { - Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled); + if (log) Logger.WriteLine(info.monitorFriendlyDeviceName + " HDR: " + colorInfo.advancedColorEnabled); return colorInfo.advancedColorEnabled; } diff --git a/app/Display/VisualControl.cs b/app/Display/VisualControl.cs index 400d18ce..dc87b73f 100644 --- a/app/Display/VisualControl.cs +++ b/app/Display/VisualControl.cs @@ -129,6 +129,8 @@ namespace GHelper.Display if (mode == SplendidCommand.None) return; if (mode == SplendidCommand.Default && init) return; // Skip default setting on init + if (ScreenCCD.GetHDRStatus(true)) return; + if (whiteBalance != DefaultColorTemp && !init) ProcessHelper.RunAsAdmin(); int balance = mode == SplendidCommand.Eyecare ? 2 : whiteBalance;