Treat DisplayServicesCanChangeBrightness as advisory on newer macOS#53
Open
dohsimpson wants to merge 1 commit into
Open
Treat DisplayServicesCanChangeBrightness as advisory on newer macOS#53dohsimpson wants to merge 1 commit into
dohsimpson wants to merge 1 commit into
Conversation
On newer Apple Silicon macOS versions, DisplayServicesCanChangeBrightness can return false even when brightness can still be handled through fallback APIs. Avoid early failure and continue to IODisplay fallback for get/set paths.
Author
|
disclosure: used codex for this patch. tested and working on M4 Macbook OS 15.7.2. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On newer Apple Silicon/macOS versions,
DisplayServicesCanChangeBrightness()can return false even when brightness operations still succeed through fallback APIs.This change avoids early failure in that case and continues to the existing IODisplay fallback for both get/set paths.
Why
Users on current macOS were seeing errors like:
brightness: unable to get brightness of display 0x5because the code treated
DisplayServicesCanChangeBrightnessas authoritative and returned before trying fallback paths.Changes
setBrightness: ifDisplayServicesCanChangeBrightnessreports false, continue to IODisplay fallback instead of failing.getBrightness: same behavior for read path.Validation
make.brightness -lvstill reports brightness on a local Apple Silicon machine.