Skip to content

Fix brightness HUD reverting to native macOS OSD on Tahoe#479

Open
Kolomaster68 wants to merge 1 commit into
Ebullioscopic:mainfrom
Kolomaster68:fix/brightness-hud-tap-timeout
Open

Fix brightness HUD reverting to native macOS OSD on Tahoe#479
Kolomaster68 wants to merge 1 commit into
Ebullioscopic:mainfrom
Kolomaster68:fix/brightness-hud-tap-timeout

Conversation

@Kolomaster68
Copy link
Copy Markdown

@Kolomaster68 Kolomaster68 commented May 29, 2026

Summary

  • Re-enable CGEvent tap after system timeout — macOS auto-disables event taps when the callback takes too long; the brightness path's synchronous CoreBrightness/DisplayServices calls were slow enough on Tahoe to trigger this. The tap was never re-enabled, permanently killing all media key interception.
  • Remove slow sync from tap callback path — moved syncWithSystemBrightnessIfNeeded() out of adjust(by:) to prevent future timeouts. Added pendingAdjustTarget to fix rapid key presses collapsing into a single brightness step.
  • Add missing early guard to brightness handler — matches the volume handler's guard volumeEnabled pattern.

Fixes #478

Test plan

  • On macOS Tahoe, press brightness keys — Dynamic Island HUD should appear instead of native OSD
  • Hold brightness key for rapid repeat — brightness should change by one step per repeat (not collapse)
  • Disable brightness HUD in settings — brightness keys should pass through to native macOS handling
  • Cmd+brightness (keyboard backlight) should still work when backlight control is enabled
  • Volume HUD should continue working as before

🤖 Generated with Claude Code

The CGEvent tap for media key interception was never re-enabled after
macOS disabled it due to a callback timeout. The brightness callback
path triggered this by calling syncWithSystemBrightnessIfNeeded()
synchronously inside the tap callback, which reads display brightness
through CoreBrightness/DisplayServices — slow enough on Tahoe to hit
the system timeout.

Three changes:
- Re-enable the tap on tapDisabledByTimeout/tapDisabledByUserInput
- Remove the slow sync from adjust(by:) and add pendingAdjustTarget
  to fix rapid key press delta accumulation
- Add missing early guard to brightness handler (matching volume)

Fixes Ebullioscopic#478

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bobby-claw added a commit to arbitraged-life/atoll that referenced this pull request May 31, 2026
- Re-enable CGEvent tap when system disables it due to timeout (Tahoe's
  slow CoreBrightness calls trigger the tap-disable timeout)
- Guard brightness handler so disabled HUD doesn't silently fall through
  to native OSD
- Add pendingAdjustTarget to prevent rapid key-repeat drift

Cherry-picked from upstream Atoll PR Ebullioscopic#479
@StudioKeys
Copy link
Copy Markdown
Collaborator

This PR is not even required as i just tested the PR and even with it its broken, here is the root cause in my setup that i had which got fixed as well, putting it here

What happens: Third-party DDC integration ON → brightnessEnabled=false → interceptBrightness=false → brightness key not swallowed → passes through → native macOS OSD. By design: it hands brightness off to an external DDC app (MonitorControl/BetterDisplay) so that app drives brightness + its own OSD.

To fix: Disable DDC Integration and it should work fine as normal and things should be fine.

Thanks though for taking the time to investigate the issue and its greatly appreciated

Cc: @Ebullioscopic

Copy link
Copy Markdown
Collaborator

@StudioKeys StudioKeys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, could be safely discarded

@Kolomaster68
Copy link
Copy Markdown
Author

Weird, it was only working that way through my debug version. Will try your method, there's been issues with Tahoe ever since 26.5 update.

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.

Brightness HUD reverts to native macOS OSD on Tahoe — CGEvent tap never re-enabled after timeout

2 participants