Skip to content

Commit

Permalink
Reported in #1317
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed Jun 4, 2024
1 parent 0c26829 commit a28dae2
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,17 @@ private void SystemEvents_DisplaySettingsChanged(object? sender, EventArgs e)
Changed?.Invoke(this, new() { HDR = changed ? IsHDROn : null });
}

private static bool? GetHDRStatus() => Displays.Get().FirstOrDefault()?.GetAdvancedColorInfo().AdvancedColorEnabled;
private static bool? GetHDRStatus()
{
try
{
return Displays.Get().FirstOrDefault()?.GetAdvancedColorInfo().AdvancedColorEnabled;
}
catch (Exception ex)
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Failed to get HDR status. Assuming unavailable.", ex);
return null;
}
}
}

0 comments on commit a28dae2

Please sign in to comment.