Repository navigation
Don't treat a screensaver closed by losing every output as a dismissal - #15244
juan-LARRAYA wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
… it with behavior tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| } else if (name === "monitorremoved") { | ||
| var removed = String(eventParts(event, 1)[0] || "") | ||
| if (root.idledThisCycle && removed !== "FALLBACK") root.holdForOutputLoss("monitorremoved " + removed) |
There was a problem hiding this comment.
Dismissal still leads to locking
Removing one monitor starts outputLossTimer even when another monitor remains connected. For the next three seconds, outputsLost() ignores genuine screensaver dismissal and activity on that remaining monitor. The pending lock stays armed and can lock the session after the user has returned. Limit the hold to losing all usable outputs, and stop suppressing real dismissal once an output is available.
Knowledge Base Used: Shell UI and desktop interactions
| PATH="$TMPDIR/stubs:$ROOT/bin:$PATH" \ | ||
| quickshell -p "$config_dir" --no-color >"$log" 2>&1 & |
There was a problem hiding this comment.
The test puts the wake stub first in PATH, but Service.qml runs it through bash -lc. On an installed Omarchy session, the login shell resets PATH, so it can run the real omarchy-system-wake instead. The test then changes the desktop and fails because the expected wake entries are missing. Add the existing bash stub pattern that replaces -lc with -c.
|
|
||
| function mark(name) { | ||
| var quoted = "'" + name.replace(/'/g, "'\\''") + "'" | ||
| Quickshell.execDetached(["bash", "-c", "echo \"S " + name + "\" >> \"$1\"", "_", wakeLog]) |
There was a problem hiding this comment.
mark() appends each scenario label through a detached process, then the scenario immediately starts wake through another process. Either process can write first, but the test requires one exact order. The 700 ms pause between scenarios does not order these two writes. Wait for the marker to finish before triggering wake, or record and check each scenario separately.
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
I reviewed this at 87e55ad against What ran, on the worker
1. Removing one monitor while another stays up can lock someone who is using the machine
Nothing re-checks the cycle when 2. This does not reach the sequence in #12327 The only blank in an idle cycle is the lock screen's own ( Before #12327 can be addressed here, we need to know what actually logs Smaller points in the test
What happens next This is waiting on you, @juan-LARRAYA. Point 1 needs a different way to tell output loss from a dismissal. One option is to hold only while no real screen remains, and to re-check the cycle when the hold ends. Point 2 needs the path in #12327 identified. I have not pushed anything, because both points are design decisions rather than contained defects. |
Cause
When the only output disappears during an idle blank (a sink that drops its link when disabled), the screensaver window goes with it.
handleScreensaverWindowClosed()reads that as the user dismissing the screensaver and callscancelIdleCycle("screensaver-dismissed"), which runsomarchy-system-wakeand undoes the blank. Hyprland'sresumedsignal that follows then goes throughhandleActiveSignal()and would cancel again as "activity". This is theidle-cycle-cancel: screensaver-dismissed/process-start: wakepair quoted in the issue.Change
IdleModel.hasRealScreen(): a screen counts only if it has a name, is not Hyprland'sFALLBACKplaceholder, and has a size (same idea as the lock service'srealScreenCount()and Ignore Hyprland FALLBACK in external-monitor checks #10586).monitorremovedevent for a non-FALLBACK monitor (so a screen list that has not updated yet does not defeat it).resumedsignal are ignored: no cancel, no wake. The pending lock timer is untouched.Scope (partial)
Refs #12327, does not close it. Covered: the idle-side half (output loss closing the screensaver, and the
resumedthat follows). Not covered:cancelIdleCycle()that Leave a locked session's display to the lock screen #9152 proposes (complementary);monitorremovedon a machine that keeps another output: it is ignored too, so the wake is skipped, and the pending lock still fires;closewindowthat arrives before both themonitorremovedevent and the screen-list update.Testing
test/shell.d/idle-output-loss-test.sh(new) loads the realService.qmlin a throwaway quickshell, injects the screen list, feeds it Hyprland events, and stubsomarchy-system-wakein PATH to record runs. Cases: close with no outputs, FALLBACK-only list,monitorremovedbefore a stale list,resumedafter the loss (cycle kept, no wake); and, still waking, FALLBACK-only removal, a real dismissal, and real activity. It fails againstquattro'sService.qml(6 checks) and passes with this change.test/shell.d/idle-test.sh: addshasRealScreencases;shell-idle-spawn-test.shandupdate-stay-awake-security-test.shpass../test/shellrun finished with 2not ok("the initial background is visible" and "releasing the shared cover reveals the cloned background"), both intest/shell.d/background-instant-reload-test.sh, unrelated to idle. Re-running that file againstorigin/quattrowithout my change, the first one fails the same way; the second did not show up in that re-run, so I did not confirm it on the base. I did not re-run the full suite after this second commit.🤖 Generated with Claude Code