Skip to content

Treat DisplayServicesCanChangeBrightness as advisory on newer macOS#53

Open
dohsimpson wants to merge 1 commit into
nriley:masterfrom
dohsimpson:fix/sonoma-canchangebrightness-fallback
Open

Treat DisplayServicesCanChangeBrightness as advisory on newer macOS#53
dohsimpson wants to merge 1 commit into
nriley:masterfrom
dohsimpson:fix/sonoma-canchangebrightness-fallback

Conversation

@dohsimpson

Copy link
Copy Markdown

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 0x5

because the code treated DisplayServicesCanChangeBrightness as authoritative and returned before trying fallback paths.

Changes

  • In setBrightness: if DisplayServicesCanChangeBrightness reports false, continue to IODisplay fallback instead of failing.
  • In getBrightness: same behavior for read path.
  • Added short comments clarifying this compatibility behavior.

Validation

  • Built universal binary with make.
  • Verified brightness -lv still reports brightness on a local Apple Silicon machine.

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.
@dohsimpson

Copy link
Copy Markdown
Author

disclosure: used codex for this patch. tested and working on M4 Macbook OS 15.7.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant