From a8c8b1bb13b5f9b349062faadc0256ea679fd797 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sun, 19 Jul 2026 01:17:10 +0200 Subject: [PATCH] fix(apple): detect macOS HDR via potential EDR headroom, not current MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `maximumExtendedDynamicRangeColorComponentValue` is the CURRENTLY-allocated EDR headroom, which macOS hands out on demand — an idle SDR desktop reads 1.0 even with an HDR display enabled and active, so gating HDR advertisement on it means an HDR monitor (e.g. Samsung G95SC) never gets advertised at connect time. Use `maximumPotentialExtendedDynamicRangeColorComponentValue`, the mode-independent capability (the macOS analogue of the tvOS/iOS gates). Also point the Xcode scheme's LaunchAction at Release. Co-Authored-By: Claude Fable 5 --- .../xcshareddata/xcschemes/Punktfunk.xcscheme | 2 +- .../Sources/PunktfunkClient/Session/SessionModel.swift | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/clients/apple/Punktfunk.xcodeproj/xcshareddata/xcschemes/Punktfunk.xcscheme b/clients/apple/Punktfunk.xcodeproj/xcshareddata/xcschemes/Punktfunk.xcscheme index 7a855ba4..d994e08f 100644 --- a/clients/apple/Punktfunk.xcodeproj/xcshareddata/xcschemes/Punktfunk.xcscheme +++ b/clients/apple/Punktfunk.xcodeproj/xcshareddata/xcschemes/Punktfunk.xcscheme @@ -30,7 +30,7 @@ shouldAutocreateTestPlan = "YES"> 1.0 + // POTENTIAL, not current, headroom: `maximumExtendedDynamicRangeColorComponentValue` + // is the CURRENTLY-ALLOCATED headroom, which macOS hands out on demand — on an idle + // SDR desktop it reads 1.0 even with HDR enabled and active (external HDR displays + // like the Samsung G95SC allocate EDR only when content asks). Gating on it means an + // HDR monitor never gets advertised at connect time. `maximumPotential…` is the + // mode-independent capability (the macOS analogue of the tvOS/iOS gates below). + return (NSScreen.main?.maximumPotentialExtendedDynamicRangeColorComponentValue ?? 1.0) > 1.0 #elseif os(tvOS) // NOT the EDR headroom here: on tvOS that reflects the CURRENT output mode, and // Apple's recommended setup runs an SDR home screen with Match Content — an