Skip to content

Defer display recovery during sleep and wake - #2

Merged
dnafication merged 3 commits into
mainfrom
copilot/fix-display-toggle-error
Nov 23, 2026
Merged

dnafication merged 3 commits into
mainfrom
copilot/fix-display-toggle-error

Conversation

@dnafication

@dnafication dnafication commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

After sleep, the built-in display can turn back on and GoDark can report CoreGraphics error 1014. Transient display loss during sleep transitions can trigger the unplug safety net.

  • Sleep and wake: Suspend automatic recovery while the system or screens are asleep, then allow time for display configuration to settle.
  • Unplug safety: Confirm display loss before restoring the built-in screen, preserving recovery when an external monitor is disconnected.

dnafication and others added 2 commits November 23, 2026 02:01
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@dnafication dnafication changed the title [WIP] Fix display toggle issue after waking from sleep Defer display recovery during sleep and wake Nov 23, 2026
@dnafication
dnafication requested a lite review from Copilot November 23, 2026 10:25
@dnafication
dnafication marked this pull request as ready for review November 23, 2026 10:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Sleep/wake and hot-unplug recovery relies on private macOS display APIs, hardware-specific behavior, and notification timing that cannot be verified automatically because the repository has no test target.

No open issues 🎉

What changed in this PR

Improves GoDark’s display recovery around macOS sleep and wake transitions while preserving recovery after genuine external-monitor loss.

Changes:

  • Tracks system and screen sleep states and delays post-wake recovery.
  • Adds delayed confirmation before restoring the built-in display.
  • Documents manual sleep, wake, and unplug testing scenarios.
File Description
GoDark/​ContentView.swift Adds sleep-state tracking, delayed wake recovery, and delayed display-loss confirmation logic.
docs/​DEVELOPMENT.md Adds manual testing instructions for sleep, wake, and external-monitor unplug recovery.

Review effort: Lite

@dnafication
dnafication merged commit e35e0f4 into main Nov 23, 2026
2 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.

The displays toggle back once awake from sleep

3 participants