Repository navigation
Conversation
Automated AI review
Verified: the two new sleep-lock scenarios are real regression tests. Each fails against the base The review found one issue in the new check: the Hyprland query it adds is not bounded by the inhibitor budget. There is also an open question about whether this resolves #13300, a misleading warning on the FALLBACK-only path, and an unrelated Windows VM commit bundled into the branch. The new
|
hyprctl behaviour |
Budget | Base | Head |
|---|---|---|---|
| answers correctly after 2.5 s | 1500 ms | not run (base reaches hyprctl only through the 0.4 s-capped clamshell sync) |
exit 1 at 2510 ms, "the shell did not secure the session within 1500ms" |
| blocks for its 5 s receive timeout | 4000 ms (5 s logind window) | exit 0 at 16 ms | exit 1 at 5011 ms, past the logind window |
| exits 1 immediately | 4000 ms (5 s logind window) | exit 0 at 12 ms | exit 1 at 4092 ms |
Each head exit 1 also sends the critical "Screen did not lock before suspend. The session was left unlocked (...)" notification.
Impact: when Hyprland IPC is slow or stalled at PrepareForSleep, a session that the shell already secured is held for up to the whole budget (12 s at the shipped 15 s window), can outlive logind's window, and ends with a false "left unlocked" warning. The script itself notes that lid transitions can stall Hyprland IPC, and undocking with the lid closed reconfigures displays.
Suggested change: run the query under timeout, clamped to the remaining budget as lock_ipc does. Distinguish "Hyprland answered and no real output is enabled" from "Hyprland could not be asked", and in the second case fall back to the previous behaviour of trusting the shell's secure.
FALLBACK-only path can report "left unlocked" for a locked session
The new undock_headless_forever test mocks a shell that reports {"secure":true} while only FALLBACK is listed, and expects failure. From source, the shell can report secure in that state: Hyprland advertises FALLBACK to clients as a named 1920x1080 output, which shell/plugins/lock/Service.qml counts as a lockable screen. In a mocked run, head waited the whole budget (4005 ms at a 4000 ms budget) and then showed "The session was left unlocked (no active display was available before suspend)". Base exited 0 in 12 ms.
Impact: the wait path never asks the shell, so when the shell has secured the session (as the new test models), the warning still says "left unlocked" although only a physical display was missing. On machines where no display can be recovered, for example a desktop whose only monitor dropped off when switched off, sync_clamshell has no internal panel to re-enable. Every such suspend then waits the full budget (12 s at the shipped window) before this warning.
Suggested change: use a message that names the actual condition, and wait only when there is something to recover, such as an internal panel or a set clamshell flag.
Related: has_active_output counts an enabled 0x0 (modeless) output as active, while Service.qml's realScreenCount() requires a non-zero size, so in that state the new wait never engages. Base behaves the same, so this is a gap rather than a regression. Requiring a non-zero size, as realScreenCount() does, would make the two agree on modeless outputs. On its own that only changes the exit message, because clamshell's external-monitor check still counts the 0x0 output and keeps eDP-1 off.
Does this resolve #13300?
The new check looks at Hyprland's monitor list, not at whether the lock client has a surface on the panel. Quickshell's secure stays true from the moment Hyprland confirms the lock until unlock. Hyprland confirms once every enabled, powered-on monitor has rendered a lock frame, immediately if there is none, and after a 5 s timer regardless. The issue's journal suggests the lock had already been requested or taken, and a real monitor had already been added, before PM: suspend entry:
22:42:33 omarchy-shell: DEBUG: Not creating lock surface for screen QScreen(..., name="") as it is not backed by a valid wayland output.
-> logged only while the shell is taking or holding the session lock (Quickshell session_lock.cpp)
22:42:33 omarchy-shell: WARN quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" which was not previously tracked.
-> Hyprland leaves fallback when a real monitor is added (FallbackState.cpp)
22:42:34 kernel: PM: suspend entry (s2idle)
In that state the new check passes, so it would not hold the suspend back if the shell had already reported secure. Opening the lid also runs omarchy-hyprland-monitor-clamshell through the locked switch:off:Lid Switch binding, and Quickshell adds lock surfaces for new screens. So "suspend overtook the re-enable" does not by itself explain a screen that stays black. This is source analysis of the journal, not a reproduction. The reporter has seen the failure once.
Impact: in the state the journal suggests, the new check would pass, so the PR's claim to fix #13300 is not established. The change may still narrow a related race.
Suggested change: unless the fix has been reproduced and verified on hardware, use "Refs #13300" instead of "Fixes #13300", or check for a lock surface on the panel rather than for an enabled monitor.
Unrelated Windows VM commit
Commit 2b4b0eba ("Clear setgid when hardening Windows VM mount folders (#1)") changes both chmod 0700 hardening sites in bin/omarchy-windows-vm to chmod 00700 and adds tests. The PR description does not mention it, and it is unrelated to #13300, so the PR bundles two unrelated fixes.
Verified: the change itself is correct. GNU chmod keeps an existing directory setgid bit for a 4-digit numeric mode (chmod 0700 on a 2777 directory gives 2700; chmod 00700 gives 700), and dockur/windows sets an empty share to 2777.
Impact: the same fix is already open in other PRs on the same lines, for example #13154 and #13213 (same chmod 00700) and #12323 (equivalent u=rwx,go=,a-s, with different test expectations).
Suggested change: drop this commit from the PR and leave the Windows VM fix to one of the dedicated PRs.
Optional test improvement: three diagnostic mutants of the head script each pass the whole head sleep-lock-test.sh: polling lock status before sync_clamshell, removing the main-loop has_active_output gate, and removing the second request_lock. The first survives because the existing check "sleep lock checks security after clamshell reconciliation" now only asserts that both calls appear somewhere in the log. Comparing the index of the first clamshell with the first shell lock status keeps the check's intent. A scenario that loses its output after the initial wait would cover the main-loop gate, and a slow or failing hyprctl case would cover the unbounded query above. The second request_lock is better removed than tested (see the optional note below).
Optional cleanup: the second request_lock is redundant. Once lockRequested is set, the shell's lock() IPC returns "ok" without acting (Service.qml), and a request that never landed is re-sent by the main loop anyway. The comment above it implies that asking again helps produce a surface, but the shell already retries on its own until a real screen exists.
Review information
Test scope: Source review of the head, merge-base and current quattro, plus Hyprland 0.56.2, Quickshell 0.3.1, gnulib/coreutils chmod and dockur/windows sources. Sleep-lock behaviour was tested only with mocked hyprctl, shell and clamshell commands in an isolated sandbox, so the timings above are from mocks. No real compositor, logind, lock screen or undock was exercised, and the #13300 analysis is not a reproduction. The Windows VM compose and mount-boundary runtime tests could not run in the sandbox. The chmod conclusion rests on a direct GNU chmod run, windows-vm-test.sh and source reading.
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.
Opt out: To stop receiving these reviews, reply to this comment saying so.
Undocking with the lid closed can suspend while only FALLBACK/empty outputs exist, so no lock surface is created and resume wakes black. Reconcile clamshell until a real monitor is enabled before treating the session as ready to sleep. Fixes omacom#13300 Co-authored-by: AnPod <AnPod@users.noreply.github.com>
ebf5341 to
06fea19
Compare
|
Reviewed at 06fea19 by Claude Opus 5.5, with a second opinion from Codex at medium effort. The idea holds up: re-running clamshell reconciliation until a real output is back addresses the race in #13300. But two defects need fixing before this can go further, and the fix still needs confirming on hardware. What ran, on a disposable Omarchy VM running this branch's shell:
Defects:
Smaller points: the extra Codex found both defects as well. It can read this review's working notes, so its agreement is not guaranteed to be independent. It contributed the point that the inhibitor is a delay inhibitor, so nothing actually fails closed, which I have checked against #13640 has the same diff as this pull request, opened a day later, and is handled as its own item. #13792 fixes overlay windows after the same kind of output loss and does not compete with this one. Next: this waits on @AnPod for the two defects. After that, it needs @azzouzidk, who opened #13300, to confirm the new head on the affected Framework 13 by undocking with the lid closed, since a VM can't suspend. The maintainer decides after that. |
Summary
Undocking with the lid closed can suspend the laptop while only FALLBACK/empty outputs exist, causing the lock client to have no real output for a surface and leaving resume waking to a black screen (#13300).
This change:
omarchy-hyprland-monitor-clamshelluntil a real monitor is enabled.test/shell.d/sleep-lock-test.shverifying active output recovery and headless fallback handling.Fixes #13300