Skip to content

Fix auto warmth restoration after display wake - #46

Merged
olujicz merged 1 commit into
mainfrom
fix/screen-wake-auto-warmth
Jul 24, 2026
Merged

Fix auto warmth restoration after display wake#46
olujicz merged 1 commit into
mainfrom
fix/screen-wake-auto-warmth

Conversation

@olujicz

@olujicz olujicz commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • observe both Mac wake and screen-only wake events through NSWorkspace.shared.notificationCenter
  • coalesce duplicate wake notifications before restoring display output
  • recalculate automatic warmth from the current time after display stabilization
  • cancel pending wake updates when automatic warmth is disabled
  • add regression coverage for system wake, screen wake, duplicate events, and cancellation

Root cause

The wake handlers registered NSWorkspace notifications on NotificationCenter.default, which does not deliver workspace wake notifications. They also observed only full system wake, so a display powered down with pmset displaysleepnow could wake without triggering gamma restoration or an immediate automatic-warmth recalculation.

User impact

Brightness, gamma, and time-based warmth are restored after both full Mac wake and display-only wake. Automatic warmth is recalculated after the display has stabilized, avoiding stale day/night temperature after the screen has been off.

Validation

  • full Dimmerly test suite
  • Dimmerly App Store scheme build
  • SwiftFormat
  • SwiftLint in strict mode (0 violations)
  • Gitleaks pre-commit hook

@olujicz
olujicz marked this pull request as ready for review July 24, 2026 14:55
@olujicz
olujicz merged commit 351d712 into main Jul 24, 2026
7 checks passed
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