Repository navigation
fix: unplugging a 2nd monitor locks the mac - #24
Merged
Merged
Conversation
Owner
|
@lbb-seu thank for the PR, is it ready for review? it's still a draft so i'm not sure |
Owner
|
ok I ran this, and it's really valuable! also i've had this bug for while (with one monitor) here my mac wakes up from sleep and I didn't even think that it was because of SD. |
fanckush
marked this pull request as ready for review
November 20, 2026 11:47
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.
Problem
In External Only mode, a display removal can queue a global sleep/wake refresh. On a MacBook Air M5 with two external displays, locking the Mac could produce a loop: the system blanked the displays, SoloDisplay emitted
SoloDisplay redrawabout two seconds later, and the displays lit again. With the session unlocked, unplugging an external display could also force the remaining display to sleep and trigger the lock screen.To reproduce the original lock-screen issue, enable External Only, lock the Mac manually, wait for the displays to sleep, and check whether they wake without user input. To exercise the unplug case, keep one external display connected while disconnecting the other. No remote desktop software is needed to reproduce the lock-screen issue.
Change
Disable forced redraw in the app's controller policy. Leave external display detection, External Only behavior, and restoration of the built-in display when the last external is unplugged unchanged. Add a controller regression covering repeated display removal/return and last-external unplug with forced redraw disabled.
Verification and trade-off