Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; no new blocking issue was found. SummaryThe PR checks Hyprland's live windows before keeping an idle cycle armed.
|
|
Reviewed at 5d45d17 against The bug isn't reproduced. On a worker running this branch's shell (Hyprland, foot, one monitor), every real dismissal I could produce closed the screensaver's windows with matching The live list can miss a screensaver window that is up. I measured this on the worker with a probe shell:
Codex worked out where this costs the lock. Say a screensaver window maps in the last few tens of milliseconds before the 3 s grace ends. The grace timer's new sync erases it, and Tests. On the worker, What it waits on. It waits on the author: either evidence that the tracked set drifts on a real machine, or a smaller change. For example, the |
The live toplevel read treats a window without a wayland handle as having an empty app id, so a screensaver window that maps inside the launch grace is read as absent and the reconciliation drops it. The launch grace then finds no screensaver window and cancels the cycle, and the screensaver stays on screen with no lock behind it. Base keeps the cycle armed, so this fails open on a lock path. The handle is attached 5-49ms after the window maps, so the app id is unknown at that point, not absent. Report it as null and keep such a window when the openwindow events already track its address. A toplevel the events never saw is still ignored, so an unidentified window cannot become a screensaver window on its own.
The toplevels watcher cancelled the cycle itself, so a dismissal it noticed first passed through a second cancel path. The window is gone either way, but what a dismissal means then lives in two places, and the reason it records depends on which path was quicker. Hand each vanished window to handleScreensaverWindowClosed() instead, which is what the closewindow event already uses, so the decision and its reason stay in one place whichever path notices first.
|
Both things you could act on are in. The live list can miss a window that is really up — The toplevels path no longer decides on its own — Tests. What I still cannot answer. The first half of your "not ready" — that the drift has not been seen on a real machine — I cannot settle from here. I do not have the reporter's four monitors, and I agree with your reading that base is correct in every flow I can construct. That is the whole reason I added the log line: it was meant to catch the next occurrence, not to justify the reconciliation on its own. So the choice between your two routes is not mine to make:
Say which you want and I will do it. I would rather not sit in the queue classified as verified while it is the second option you asked for. |
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
|
Decision on the scope question above: keeping the reconciliation and the The reason is the fail-open in So what this waits on now is the same thing as before, and it is not something more review will settle: an occurrence of the drift on a real machine. The log line is there to catch it on #15066's setup. |
|
Re-reviewed at 5d01895 against What's fixed. The log line can't tell drift from a normal close. In that same run the journal showed The live list doesn't back up the event stream. In Quickshell 0.3.2's source ( One interaction to know about. Opening a window no longer stops the launch grace timer. With #15244 applied, losing every output in the first 3 s after launch would be held by its guard in the close handler, but then the grace timer would cancel the cycle as Tests. On the worker: What it waits on. You've put the choice of route to the maintainer, and it stays there. Both reviewers and I still read #15066 as unexplained: base clears the cycle before it locks, and the reported cycle surviving an unlock doesn't fit a missed |
|
Closing as superseded — upstream replaced the mechanism this was built on. #16800 ("Replace the terminal screensaver with the native Wayland one"), merged 2026-10-28, contains
So this cannot be rebased — the conflict is not textual, it is that the code being patched no longer exists. Re-proposing it would mean rewriting against the native Wayland screensaver rather than porting this diff. Worth recording that the review's central objection was never answered: the If the native screensaver turns out to have the same outliving-cycle problem, that wants a fresh issue against the new implementation and a diagnostic that logs each raw Thanks to everyone who reviewed and tested this one while it was open. |
Fixes #15066.
Problem
An idle cycle can stay armed after the screensaver it launched is gone.
omarchy-shell idle statusthen keeps reportinginIdleCycle: truewhile the user works, and anything that reads that flag as "the user is idle" acts on a user who is not. In #15066 a plugin suspended the machine every few minutes during normal use.The reporter's corrected journal shows a cycle that never cancels:
No
idle-cycle-cancelline of any kind appears for that boot, and the grace-timer fallback (screensaver-not-running) never fires even though it is started with the cycle.Cause
Both decisions that keep the cycle armed read
screensaverWindowCount, which is accumulated from the Hyprlandopenwindow/closewindowraw events:handleActiveSignal()ignores activity whilescreensaverWindowCount > 0, so every lateractivesignal is swallowed while the count is wrong.screensaverWindowCount === 0, andhandleScreensaverWindowOpened()stops that timer as soon as one window opens, so the fallback is disabled for the rest of the cycle.A tracked window whose
closewindowevent never arrives, or which closes while the count is already out of step, therefore keeps the cycle armed for as long as the session lasts. Nothing else can end it: the main idle monitor reportedactiveonce, from the launch itself, and stays active while the user works, so no furtherisIdleChangedtransition arrives to re-evaluate.Change
Ask Hyprland what the screensaver is doing now, at the moment the decision is made, instead of trusting the windows the events have accumulated.
IdleModel.screensaverWindowsFrom(entries, className)builds the set from the live toplevels: the windows whose app id is the screensaver's, counted by address, once each. Pure and unit tested.Service.qmlgainsliveScreensaverWindows()(readsHyprland.toplevels.values, answersnullif the list cannot be read so a caller keeps what the events tracked) andsyncScreensaverWindows(), which replaces the tracked set and logsscreensaver-windows live=N tracked=Mwhen the two disagree, so the next journal shows this case immediately.handleActiveSignal()syncs before it decides, so a stale count can no longer hold activity off.handleScreensaverWindowOpened()no longer stops it. By the time it fires, the screensaver has either stayed up, which keeps the cycle armed, or gone with the user's return, which ends it.ConnectionsonHyprland.toplevelswatches the live window list itself, so the cycle also ends when the screensaver window goes away with noclosewindowevent at all:handleToplevelsChanged()syncs and cancels withscreensaver-closed. It leaves the launch window to the grace timer and keeps the cycle armed while any screensaver window is still live.bin/omarchy-launch-screensaverexits as soon as the windows have opened.The guard itself is unchanged: the compositor still reports activity when the screensaver launches, and a cycle whose screensaver is genuinely up still stays armed for the lock deadline. The difference is that "the screensaver is up" is now read from Hyprland rather than from event bookkeeping that can drift.
Neighbours
closewindowpath to cancel the cycle. This does not touch dismissal, and it is the fallback for the case that path misses; Dismiss screensaver on pointer activity after launch settle #12975's own assertions still hold.bin/omarchy-launch-screensaver.Tests
bash test/shell.d/idle-test.shpasses (6 new model checks and 8 new wiring checks)../test/shellfails the same 19 files as unmodifiedquattroon this machine, apart from the known flakyshell-idle-spawn-test.sh, which is not among them here.