Skip to content

Wake the panel when a laptop-only lid opens - #10462

Open
codemonkey76 wants to merge 1 commit into
omacom:quattrofrom
codemonkey76:fix-laptop-only-lid-open-dark-panel
Open

Wake the panel when a laptop-only lid opens#10462
codemonkey76 wants to merge 1 commit into
omacom:quattrofrom
codemonkey76:fix-laptop-only-lid-open-dark-panel

Conversation

@codemonkey76

Copy link
Copy Markdown
Contributor

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 from enable_internal(), behind if (( 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's idleBlankTimer blanks the panel five seconds after a lid-close lock. So a laptop-only lid resume returns to a dark screen with no path back. Only Keys.onPressed on the lock screen's password field reaches omarchy-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 existing omarchy-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's recover() 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, and omarchy-brightness-display on already exits early while every enabled monitor reports dpmsStatus true.

Test plan

  • New test/shell.d/lid-open-test.sh asserts 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.sh updated for the new binding.
  • ./test/all — the only failure is bin-style-test.sh, which fails identically on the base commit (raw command -v in the AI app removers, fixed separately in Use the command helper in the AI app removers #10460).
  • Hardware A/B on a laptop-only machine (Intel CometLake-H + NVIDIA hybrid, eDP-1 only, deep S3), blanking the panel exactly as the lock screen does:
blanked (as after lid-close lock): [{"name":"eDP-1","dpmsStatus":false}]
after omarchy-system-lid-open   : [{"name":"eDP-1","dpmsStatus":true}]

blanked again                   : [{"name":"eDP-1","dpmsStatus":false}]
after monitor-clamshell alone   : [{"name":"eDP-1","dpmsStatus":false}]   <- current binding

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: 1 while the panel was dark, and I can't now reconstruct whether that reading was taken before or after a manual dpms 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

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
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