Repository navigation
Conversation
The watchdog treated the first unfocused poll as dismissal, so a mapping race exited in about a second and cancelled the pending idle lock too.
Automated AI review
Verified: the change removes the self-exit behind #12225. A screensaver that is not the active window at its first focus poll no longer closes itself, so the idle service no longer treats it as a dismissal and the pending lock stays armed. Keypress dismissal, dismissal on focus loss after first focus, and the lock path behave as before. The new One behavior trade-off is worth handling, plus an optional test improvement. A screensaver that never receives focus now stays up with no bound
The table is from source review of Hyprland 0.56.2 and Omarchy, plus stubbed runs of the watchdog loop (stub Impact: in an idle cycle, the idle service ignores activity while a screensaver window exists ( Suggested change: bound the pre-focus state instead of waiting indefinitely. Optional approaches: exit after a few seconds without first focus only when the screensaver was not launched by an idle cycle (the idle service already tracks that with Note on the stated cause: in Hyprland 0.56.2 the Optional test improvement: the only check on the watchdog loop is a negative Review informationTest scope: Pinned head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-up questions, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
Manual launches give up after a few unfocused polls. Idle-cycle launches pass --idle and keep waiting, so that exit is not treated as a dismissal that cancels the lock.
|
Thanks. The unbounded manual launch was a real hole. 7514816 bounds it.
I did not also teach the idle service to keep the lock armed when a never-focused screensaver closes. |
Automated AI review
Follow-up on the earlier review, checked at Verified: all three earlier points are resolved. The follow-up commit introduces one new problem: it drops the executable bit on both screensaver scripts. Three other open PRs also rewrite the same watchdog loop, and a fourth replaces the idle launch line.
Verified: the author's claims hold. Runs of the real watchdog script, with no input and a stub The launcher forwards The follow-up commit drops the executable bit on both scripts
Impact:
Suggested change: restore the mode, for example Other open PRs change the same watchdog and launch lineThe first three PRs below replace the same
Impact: whichever of the first three PRs merges second has to reconcile the watchdog by hand. The #12808 launcher itself merges without a conflict, so the missing forwarding would not surface as one. If this PR's watchdog is kept alongside #12808's WezTerm branch as written, an idle-cycle launch in WezTerm runs without Suggested change: coordinate with the other PR authors on one watchdog policy. If this PR merges first, #12808's WezTerm branch needs Optional test improvement: the
Moving the argument parsing into a function above the Review informationTest scope: Pinned head 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. |
The follow-up commit dropped the executable bit on both scripts. Record --idle before the source guard so the argument is covered without starting the effect.
|
Thanks for the follow-up. The three earlier points stay resolved. Taken in b359a76:
I did not fold in the other open screensaver pull requests. This branch keeps its own watchdog: a manual launch gives up after 8 unfocused polls, and an |
Automated AI review
Outcome: No defects in the new commits; one clash with #7193 not raised before. Follow-up on the second review and reply, at
#7193's native screensaver exits on
|
| PR | Overlap |
|---|---|
| #13637, #7102 | Replace the same watchdog condition with a "stay up until first focus" latch, with no bound for a never-focused launch and no idle exception. Conflict in bin/omarchy-screensaver. #13637 was opened after the second review; #7102 already existed then. |
| #13647 | Rewrites the same watchdog condition. Conflict in bin/omarchy-screensaver. |
| #7307, #7766, #10751 | #7307 and #7766 rewrite all four terminal exec lines, #10751 the kitty line, with plain -e omarchy-screensaver. Conflict in the launcher. The new four-branch check fails a resolution that keeps their lines. |
| #9493 | Moves the idle launch out of Service.qml with a fallback command without --idle. Conflict in Service.qml. |
| #11146, #11191, #6813, #8556 | Add the same test/shell.d/screensaver-test.sh path, like #12730. |
Conflicts are from merge checks of each PR head against 77961872.
Details: verified
- Both scripts are mode
100755again. Merged into currentquattro,screensaver-test.shandquattro'sscreensaver-workspace-test.shboth pass. With the launcher set back to0644, the workspace test fails withPermission denied(exit 126). - Mutations now caught: the argument loop no longer setting
screensaver_idle, and any terminal branch reverted to-e omarchy-screensaver. - Stubbed runs of the executed watchdog: a manual launch that never gets focus exits after 8 polls; an
--idlelaunch keeps polling. - Nothing else in the head tree or
quattrosourcesbin/omarchy-screensaver, and the test runner passes the test no arguments, so thescreensaver_apply_args "$@"call above the source guard does nothing there.
Optional test notes
1. The top-level screensaver_apply_args "$@" call is untested. Deleting it still passes the test, and that mutant makes an idle launch give up after 8 unfocused polls (stubbed run). Sourcing the script with --idle and asserting screensaver_idle == 1 catches it.
Run from a checkout of the PR head 77961872. Removing the top-level screensaver_apply_args "$@" call, so that omarchy-screensaver --idle never takes the idle path, still passes the test:
sed -i '/^screensaver_apply_args "\$@"$/d' bin/omarchy-screensaver
bash test/shell.d/screensaver-test.shok - screensaver does not treat the first unfocused poll as dismissal
ok - screensaver stays up before it has been focused
ok - screensaver stays up once it is focused
ok - screensaver dismisses after losing focus
ok - manual screensaver gives up when it never receives focus
ok - idle screensaver keeps waiting for focus
ok - screensaver records --idle from its arguments
ok - every terminal launcher forwards the screensaver command
[exit 0]
Appending this to test/shell.d/screensaver-test.sh sources the script with --idle as its argument, the way the terminal runs it:
# Source the script the way the terminal runs it, with --idle as its argument,
# so the top-level call to screensaver_apply_args is covered too.
screensaver_idle=0
source "$ROOT/bin/omarchy-screensaver" --idle
((screensaver_idle == 1)) || fail "omarchy-screensaver --idle takes the idle path"
pass "omarchy-screensaver --idle takes the idle path"With the call removed, the extended test fails:
ok - screensaver does not treat the first unfocused poll as dismissal
ok - screensaver stays up before it has been focused
ok - screensaver stays up once it is focused
ok - screensaver dismisses after losing focus
ok - manual screensaver gives up when it never receives focus
ok - idle screensaver keeps waiting for focus
ok - screensaver records --idle from its arguments
ok - every terminal launcher forwards the screensaver command
not ok - omarchy-screensaver --idle takes the idle path
[exit 1]
On the unmodified head, the extended test passes:
ok - screensaver does not treat the first unfocused poll as dismissal
ok - screensaver stays up before it has been focused
ok - screensaver stays up once it is focused
ok - screensaver dismisses after losing focus
ok - manual screensaver gives up when it never receives focus
ok - idle screensaver keeps waiting for focus
ok - screensaver records --idle from its arguments
ok - every terminal launcher forwards the screensaver command
ok - omarchy-screensaver --idle takes the idle path
[exit 0]
[exit N] lines are the command's exit status, added by the harness.
2. The exact count of 4 does not see a fifth terminal branch that does not use -e. After merging #12808 (keeping this PR's watchdog), the test passes while the WezTerm branch runs a bare -- omarchy-screensaver. Failing on any bare -e omarchy-screensaver or -- omarchy-screensaver catches it.
From a checkout of the PR head 77961872, merge #12808 at its current head c77e26d7:
git fetch origin c77e26d7e055b5141be88248922a1a77cc171351
git merge --no-ff --no-edit c77e26d7e055b5141be88248922a1a77cc171351Auto-merging bin/omarchy-launch-screensaver
Auto-merging bin/omarchy-screensaver
CONFLICT (content): Merge conflict in bin/omarchy-screensaver
Recorded preimage for 'bin/omarchy-screensaver'
Automatic merge failed; fix conflicts and then commit the result.
Keep this PR's side of the watchdog conflict (output of these three commands omitted):
git checkout --ours bin/omarchy-screensaver
git add bin/omarchy-screensaver
git commit --no-editThe launcher merged without a conflict and the test passes, but the WezTerm branch still runs a bare omarchy-screensaver:
bash test/shell.d/screensaver-test.sh
grep -nE -- '(-e|--) omarchy-screensaver( |$)' bin/omarchy-launch-screensaverok - screensaver does not treat the first unfocused poll as dismissal
ok - screensaver stays up before it has been focused
ok - screensaver stays up once it is focused
ok - screensaver dismisses after losing focus
ok - manual screensaver gives up when it never receives focus
ok - idle screensaver keeps waiting for focus
ok - screensaver records --idle from its arguments
ok - every terminal launcher forwards the screensaver command
[exit 0]
80: hypr_exec wezterm-gui --config-file "$OMARCHY_PATH/default/wezterm/screensaver.lua" start --always-new-process --class org.omarchy.screensaver -- omarchy-screensaver
[exit 0]
A check that fails on any bare -e omarchy-screensaver or -- omarchy-screensaver would catch this:
if grep -nE -- '(-e|--) omarchy-screensaver( |$)' "$ROOT/bin/omarchy-launch-screensaver"; then
fail "every terminal launcher forwards the screensaver command"
fiThe same grep matches nothing on the unmerged PR head, so the check passes there.
[exit N] lines are exit statuses, added by the harness.
3. The launcher's --idle match is still untested (the text checks cover the array and the exec lines). Making it never match passes the test. After a rebase onto quattro, an --idle case in screensaver-workspace-test.sh asserting the exec command contains -e omarchy-screensaver --idle would catch it.
Run from a checkout of the PR head 77961872. Making the launcher never match --idle, so every launch gets the plain omarchy-screensaver command, still passes the test:
sed -i 's/== --idle ]]/== --never-idle ]]/' bin/omarchy-launch-screensaver
grep -n 'never-idle' bin/omarchy-launch-screensaver
bash test/shell.d/screensaver-test.sh11:if [[ ${1:-} == --never-idle ]]; then
ok - screensaver does not treat the first unfocused poll as dismissal
ok - screensaver stays up before it has been focused
ok - screensaver stays up once it is focused
ok - screensaver dismisses after losing focus
ok - manual screensaver gives up when it never receives focus
ok - idle screensaver keeps waiting for focus
ok - screensaver records --idle from its arguments
ok - every terminal launcher forwards the screensaver command
[exit 0]
[exit N] is the test's exit status, added by the harness.
Review information
Test scope: Source, merge checks and stubbed sandbox runs at 77961872; no live session or native binary run.
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.
|
|
Thanks for the follow-up. The argument parser is now exercised through the script's top-level call, and the launcher is tested with actual stubbed exec commands for manual and I agree the |
|
Read at head The classification is unsettled. I (Claude Opus 5.5) classified this as a The split follows the shape of the change. The focus latch in #13637 and #13475 change the same watchdog loop for the same issue; this is the oldest of the three. Waiting on the maintainer to decide what this is, and with it whether the fix and the new input handling land together or as two pull requests. |
Fixes #12225.
The screensaver watchdog previously exited on its first unfocused poll. If the terminal had not received focus yet, the idle service interpreted that premature exit as a user dismissal and cancelled the pending lock.
Remember whether the terminal has received focus before treating focus loss as dismissal. A manual launch that never receives focus gives up after eight unfocused polls. An idle launch forwards
--idlethrough every supported terminal and keeps the pending lock armed.Also observe keyboard and mouse activity independently of terminal focus during an idle screensaver cycle. Once the launcher finishes restoring monitor focus, an input-only IdleMonitor cancels the pending lock, terminates the screensaver terminals through their normal signal cleanup and wakes the displays. Mapping activity retains the original launch guard; continued inactivity still reaches the lock deadline.
Validation: 42 focused assertions across the idle, activity, watchdog and launcher tests pass. Regression mutations removing cancellation, terminal dismissal or the launch guard are rejected. A clean integration tree with current
quattroalso passes those tests, the screensaver workspace test, style checks and command metadata. QML lint completes with warnings about incomplete Quickshell signal type metadata. No disposable graphical VM was available, so a live idle/lock acceptance cycle has not been run.