Fix Mission Control, brightness controls, and cursor dimming#9
Open
gitkamaal wants to merge 3 commits intolevelsio:mainfrom
Open
Fix Mission Control, brightness controls, and cursor dimming#9gitkamaal wants to merge 3 commits intolevelsio:mainfrom
gitkamaal wants to merge 3 commits intolevelsio:mainfrom
Conversation
- Lower window level from .screenSaver (1000) to custom 200 to avoid macOS special-casing during Mission Control that hides the overlay, and to prevent cursor compositing interference that dims the mouse pointer - Add activeSpaceDidChangeNotification observer to reassert overlay after Mission Control or space switches (fixes levelsio#8) - Track EDR headroom changes in watchdog (1.5s interval, down from 3s) so keyboard brightness adjustments dynamically clamp the boost level instead of exceeding available headroom - Deactivate gracefully when EDR headroom drops to 1.0 (very low brightness) - Add .ignoresCycle and .animationBehavior = .none to prevent the overlay from appearing in Mission Control window list and animation glitches - Fix kill switch: use pgrep + targeted kill instead of pkill to avoid the --kill process terminating itself - Add screen wake observer with delay for correct EDR reporting - Extract reassertOverlay() and updateBoostMenuState() to reduce duplication Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
KeepAlive was set to unconditional true, so launchd restarted xdr-boost every time it exited — including user-initiated Quit and --kill. Changed to SuccessfulExit: false so launchd only restarts on crashes (non-zero exit code), not on clean exits (exit 0). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ntegration
Root causes of flicker:
- handleDisplayChange did a full deactivate/reactivate cycle, causing a
visible flash every time brightness keys were pressed
- Watchdog at 1.5s was comparing frames with display:true, forcing redraws
- Exact float comparison on maxEDR fired on tiny jitter
- Multiple event handlers could overlap with no debouncing
Fixes:
- handleDisplayChange now updates overlay IN-PLACE (resize frame, update
clear color) instead of destroy/recreate — no more flash
- Restore .screenSaver window level (200 was too low and got caught in
Mission Control window management)
- Separate boostLevel (user's choice) from effectiveBoost (clamped to
maxEDR) so the user's preference is preserved when headroom fluctuates
- Use epsilon (0.05) for float comparisons to avoid jitter-triggered updates
- Add debouncing via DispatchWorkItem for reassert calls
- Watchdog back to 3s as a safety net — event observers handle time-sensitive
recovery (space change, screen wake)
- Watchdog no longer touches window frame — only checks visibility
- Menu bar shows "☀︎ 2.0x" when active, plain "☀" when off
- Menu shows EDR headroom info
- Better toggle labels ("Turn On/Off XDR Boost")
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
activeSpaceDidChangeNotificationand reasserting the window after space switches.screenSaver(1000) to a custom level (200), which avoids macOS special-casing that interferes with cursor compositing during Mission Control--kill) no longer terminates itself; usespgrep+ targetedkillinstead ofpkill -fChanges
.screenSaver→ custom 200 (above all apps, avoids system special-casing)activeSpaceDidChangeNotificationobserver +reassertOverlay()maximumPotentialExtendedDynamicRangeColorComponentValueand clamps boost.ignoresCycle(hides from Cmd+Tab) and.animationBehavior = .nonescreensDidWakeNotificationobserver with delay for correct EDR reportingpgrep+ per-PIDkillinstead ofpkill -f(avoids self-termination)reassertOverlay()andupdateBoostMenuState()helpersTest plan
xdr-boost --killwhile another instance is running — verify it kills the other instance, not itself🤖 Generated with Claude Code