brightness: System brightness setting is not updated (macOS 10.13.1)

It seems brightness does not update the brightness setting in the system. This can be observed from the display settings (System Preferences > Displays), the slider does not change even after quitting / reopening preferences.

This can also be observed on a Touch Bar, the position of the brightness slider does not update after running brightness.

Steps to reproduce:

  1. Set brightness to max (in System Preferences)
  2. Quit System Preferences
  3. Run brightness 0.5
  4. Check brightness in System Preferences, still at max

I think this is related to #20.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (6 by maintainers)

Commits related to this issue

Most upvoted comments

In case someone is stuck on this, I made a quick tool for managing the the brightness of the internal MacBook display macos-brightness (the internal display limitation is just because I didn’t bother making it more flexible).

@nriley if you’re interested in fixing this issue, there’s essentially two private APIs, part of CoreBrightness that can be used:

double CoreDisplay_Display_GetUserBrightness(CGDirectDisplayID id);
void CoreDisplay_Display_SetUserBrightness(CGDirectDisplayID id, double b);

I’ve only tested this on Mojave, but I imagine it should work on High Sierra as well.

Hi @mafredri, thanks! This seems like it’d be pretty easy to change (much nicer than the last SPI I reverse engineered years ago!) and may resolve some of the issues people have reported with brightness. I’ve got some upcoming deadlines but do plan on adopting this if it works as well as you say.

In case someone is stuck on this, I made a quick tool for managing the the brightness of the internal MacBook display macos-brightness (the internal display limitation is just because I didn’t bother making it more flexible).

@nriley if you’re interested in fixing this issue, there’s essentially two private APIs, part of CoreBrightness that can be used:

double CoreDisplay_Display_GetUserBrightness(CGDirectDisplayID id);
void CoreDisplay_Display_SetUserBrightness(CGDirectDisplayID id, double b);

I’ve only tested this on Mojave, but I imagine it should work on High Sierra as well.

Thanks @colneck for the reminder (and @mafredri for the original suggestion) — finally got around to this. I’ve only tested on 10.14.5 with my MacBook Pro’s built-in display but I suspect it’ll work much more widely. @colneck let me know if you can compile it yourself or you need me to post a binary.

Unlike the function keys it doesn’t seem to update System Preferences if it’s open; there’s obviously some kind of notification mechanism that this doesn’t trigger. (Update: I fixed this).

From what I can tell the CoreDisplay stuff goes back to at least 10.12.6 and I suspect 10.12.4 since that was where Night Shift was introduced. I haven’t tested to see if it breaks pre-10.12 yet but will do so before announcing a new release. If it works, I plan on switching the minimum OS release to 10.8 since many years have passed.