[GH-ISSUE #1287] HDR is occasionally disabled upon resume from sleep #734

Closed
opened 2026-05-05 06:36:13 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @kohlschuetter on GitHub (Jan 15, 2023).
Original GitHub issue: https://github.com/MonitorControl/MonitorControl/issues/1287

Before opening the issue, have you...?

  • Searched for existing issues
  • Looked through the wiki
  • Updated MonitorControl to the latest version (if applicable)

Describe the bug

When I resume my 14" M1 MacBook Pro from sleep, my external monitor's HDR state is lost occasionally.

Sometimes, all I need to do is to re-enable it through System Preferences. Sometimes, the HDR checkbox is not present (in which case disconnecting/reconnecting the USB-C cable works).

I've managed to re-enable HDR through SkyLight.framework using the "hoder" tool I just wrote [1] (hat tip to @joevt [2] for pointing at the right commands)

Maybe you could add a preference to MonitorControl to always re-enable HDR on a per-display basis?

Steps to reproduce

  1. Resume your M1 Mac from sleep while an external HDR display (here: MateView 28) is connected.
  2. Occasionally see "USB-C Native" mode instead of "USB-C HDR".
  3. Re-enable using System Preferences or "hoder" tool

Expected behavior

HDR state should not be changed (this may be a system-level bug we have to work around)

Anything else?

[1] https://github.com/kohlschuetter/hoder
[2] https://github.com/joevt/AllRez

Environment Information (please complete the following information)

- macOS version: 13.1 (22C65)
- Mac model: MacBookPro18,4
- MonitorControl version: 4.1.0
- Monitor(s): internal display, MateView 28 (wired)
- Apple Silicon/M1 (yes or no): yes
Originally created by @kohlschuetter on GitHub (Jan 15, 2023). Original GitHub issue: https://github.com/MonitorControl/MonitorControl/issues/1287 ### Before opening the issue, have you...? - [X] Searched for existing issues - [X] Looked through [the wiki](https://github.com/MonitorControl/MonitorControl/wiki) - [X] Updated MonitorControl to the latest version (if applicable) ### Describe the bug When I resume my 14" M1 MacBook Pro from sleep, my external monitor's HDR state is lost occasionally. Sometimes, all I need to do is to re-enable it through System Preferences. Sometimes, the HDR checkbox is not present (in which case disconnecting/reconnecting the USB-C cable works). I've managed to re-enable HDR through `SkyLight.framework` using the "hoder" tool I just wrote [1] (hat tip to @joevt [2] for pointing at the right commands) Maybe you could add a preference to MonitorControl to always re-enable HDR on a per-display basis? ### Steps to reproduce 1. Resume your M1 Mac from sleep while an external HDR display (here: MateView 28) is connected. 2. Occasionally see "USB-C Native" mode instead of "USB-C HDR". 3. Re-enable using System Preferences or "hoder" tool ### Expected behavior HDR state should not be changed (this may be a system-level bug we have to work around) ### Anything else? [1] https://github.com/kohlschuetter/hoder [2] https://github.com/joevt/AllRez ### Environment Information (please complete the following information) ```markdown - macOS version: 13.1 (22C65) - Mac model: MacBookPro18,4 - MonitorControl version: 4.1.0 - Monitor(s): internal display, MateView 28 (wired) - Apple Silicon/M1 (yes or no): yes ```
Author
Owner

@waydabber commented on GitHub (Jan 20, 2023):

Hi there,

Note: there is a fully supported and documented way to reliably detect if the display supports HDR (check if an XDR display is in not in an SDR preset or if the external display is currently in HDR mode) - it's best to use this: you need to check the potential EDR range - simply check if NSScreen's maximumPotentialExtendedDynamicRangeColorComponentValue for the given display is greater than 1.0 (this means there is an EDR headroom available which for third party displays is always a fixed number, for XDR it is changing relative to current hardware brightness levels). You can even subscribe to a notification if this changes. An other, less professional but still technically supported way for Apple Silicon is to get the display data from the I/O registry tree and check if SupportsHDRGammaEOTF is 1 - this should work for external displays. The third option is to use undocumented stuff like SkyLight framework (update: I rechecked the issue, it seems to work fine after all) or the the MonitorPanel framework and check against preferHDRModes but that framework is a huge resource burden.

I'm saying these as input if you are willing to implement this feature in MonitorControl as a contributor. :)

Anyways, I implemented this feature in BetterDisplay if you are interested:

Screenshot 2023-01-20 at 17 07 27
<!-- gh-comment-id:1398608886 --> @waydabber commented on GitHub (Jan 20, 2023): Hi there, Note: there is a fully supported and documented way to reliably detect if the display supports HDR (check if an XDR display is in not in an SDR preset or if the external display is currently in HDR mode) - it's best to use this: you need to check the potential EDR range - simply check if NSScreen's `maximumPotentialExtendedDynamicRangeColorComponentValue` for the given display is greater than `1.0` (this means there is an EDR headroom available which for third party displays is always a fixed number, for XDR it is changing relative to current hardware brightness levels). You can even subscribe to a notification if this changes. An other, less professional but still technically supported way for Apple Silicon is to get the display data from the I/O registry tree and check if `SupportsHDRGammaEOTF` is `1` - this should work for external displays. The third option is to use undocumented stuff like SkyLight framework _(update: I rechecked the issue, it seems to work fine after all)_ or the the MonitorPanel framework and check against `preferHDRModes` but that framework is a huge resource burden. I'm saying these as input if you are willing to implement this feature in MonitorControl as a contributor. :) Anyways, I implemented this feature in [BetterDisplay](https://betterdisplay.pro) if you are interested: <img width="585" alt="Screenshot 2023-01-20 at 17 07 27" src="https://user-images.githubusercontent.com/37590873/213747291-8dc9f413-731d-4f1e-ba34-3f38a8bfc622.png">
Author
Owner

@waydabber commented on GitHub (Jan 20, 2023):

(note: forgot to add - right, there is really no public API to switch the display to HDR mode which is crazy, you can do it using SkyLight or MonitorPanel).

<!-- gh-comment-id:1398665352 --> @waydabber commented on GitHub (Jan 20, 2023): (note: forgot to add - right, there is really no public API to switch the display to HDR mode which is crazy, you can do it using SkyLight or MonitorPanel).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/MonitorControl#734
No description provided.