Wake the panel when a laptop-only lid opens - #10462
Open
codemonkey76 wants to merge 1 commit into
Open
Conversation
The lid-open binding runs the clamshell reconciler, which dispatches a DPMS enable only when it has just cleared a clamshell flag. That flag is never written on a laptop with no external monitor, so nothing in the reconciler ever fires there. The lock screen's idleBlankTimer blanks the panel five seconds after a lid-close lock, so a laptop-only resume comes back to a dark screen with no path to light it. Only a keypress reaching the lock screen's password field does, and logind swallows the power button, so reaching for that instead makes a resumed machine look hung. Bind lid open to a handler that reconciles and then wakes. omarchy-brightness-display on already skips its dispatch while every enabled monitor reports dpmsStatus true, so a lid open that never blanked stays a no-op -- the reconciler itself must keep that property, since the clamshell watcher polls it every few seconds. Refs omacom#10170 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p9Qh6dX4FuwBJAWhNPVbn
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.
Fixes the gap reported in #10170, whose analysis this follows.
The lid-open binding runs
omarchy-hyprland-monitor-clamshell. That reconciler dispatches a DPMS enable only fromenable_internal(), behindif (( changed ))— true only when a clamshell flag file was just removed. The flag is never written when there is no external monitor, so on a laptop-only machine the reconciler runs and dispatches nothing.Meanwhile
lock/Service.qml'sidleBlankTimerblanks the panel five seconds after a lid-close lock. So a laptop-only lid resume returns to a dark screen with no path back. OnlyKeys.onPressedon the lock screen's password field reachesomarchy-system-wake, and logind swallows the power button (10-ignore-power-button.conf) — so the machine looks hung to anyone who reaches for the power button rather than typing.The fix
Bind lid open to
omarchy-system-lid-open, mirroring the existingomarchy-system-lid-close: reconcile first, exactly as before, then wake.The wake had to stay a no-op when nothing is dark —
omarchy-hyprland-monitor-internal'srecover()warns that an unconditional wake "undoes lock-screen blanking and races the resume modeset into a visible flash", and the clamshell watcher polls the reconciler every few seconds. Two things keep that true here: the wake sits on a lid-switch event rather than in the polled reconciler, andomarchy-brightness-display onalready exits early while every enabled monitor reportsdpmsStatustrue.Test plan
test/shell.d/lid-open-test.shasserts the handler reconciles first, then wakes, and does nothing else. Verified non-vacuous — dropping the wake line fails it with "second call was none".test/shell.d/monitor-recovery-test.shupdated for the new binding../test/all— the only failure isbin-style-test.sh, which fails identically on the base commit (rawcommand -vin the AI app removers, fixed separately in Use the command helper in the AI app removers #10460).eDP-1only, deep S3), blanking the panel exactly as the lock screen does:Scope note: this machine hit a dark panel on an 11-hour lid-closed resume (lid closed 19:07:14, opened 06:32:06, no external monitor), which is what led here. The structural gap above is confirmed and fixed. I can't prove it was the only cause of that particular incident — one observation from it recorded
dpmsStatus: 1while the panel was dark, and I can't now reconstruct whether that reading was taken before or after a manualdpms enable. If a compositor-vs-hardware desync also exists on this hardware, it is a separate bug and this does not address it.🤖 Generated with Claude Code
https://claude.ai/code/session_013p9Qh6dX4FuwBJAWhNPVbn