Repository navigation
Close screensaver on mouse move/click. - #16790
omarchybot wants to merge 7 commits into
Conversation
Keep window tracking across idle cycles so manually started screensavers remain dismissible. Signed-off-by: Eryk Wieliczko <eryk@wieliczko.ninja>
The launcher stops waiting for each window after five seconds and then sends screensaverReady. A terminal that maps later found the arm timer already spent, so the screensaver stayed up through mouse movement until a key was pressed. Restarting the arm timer whenever an unarmed screensaver window opens covers that window too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-spark-1.3-contributor High <noreply@meta.com>
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new actionable issue was found. SummaryThe PR dismisses screensavers on mouse movement, clicks, scrolling, and keys through compositor input notifications.
Both previous findings are addressed.
|
The idle service built its set of screensaver windows from Hyprland's openwindow and closewindow events. Since the set now lives across idle cycles, one missed close would leave it non-empty for good: the 1 ms input monitor would stay on and activity would stop cancelling a pending lock. A shell started while a screensaver was up never saw it at all, so mouse input could not dismiss it. Reading the count from ToplevelManager instead follows the windows that exist, and Wayland reports every close. That drops the raw-event handler and the two model helpers that only served it. The new runtime test opens a screensaver before the service starts, another after, closes both, and fails on the event-built set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arming whenever a screensaver window opened also armed it while the launcher was still opening screensavers on other monitors: with a terminal slower than 500 ms to map, moving the mouse mid-launch killed the screensavers already up while the launcher went on opening the rest. The launcher now reports when its launch starts, and a window opening arms input only when no launch is in progress -- a late map after screensaverReady, or a screensaver already up when the shell starts. Every screensaver closing clears the flag, so a launcher killed mid-launch cannot leave it set past its windows. The runtime check moves into idle-test.sh, where the area's tests live, and covers the mid-launch case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A launcher killed mid-launch never sends screensaverReady, so its screensavers stayed unarmed: mouse input could not dismiss them, and launching again exits on finding one already running. The launcher waits at most five seconds per monitor, so after thirty seconds the service treats the launch as finished and arms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-spark-1.3-contributor High <noreply@meta.com>
Thirty seconds from the start of a launch did not cover every real launch: seven monitors whose terminals each take most of the launcher's five-second wait outlast it, and the deadline then armed input mid-launch. Restarting it whenever a screensaver opens during a launch makes it the time since the launch last made progress, which covers any number of monitors; fifteen seconds allows a monitor whose window never maps between two that do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-spark-1.3-contributor High <noreply@meta.com>
Restarting the launch deadline when a screensaver opened assumed at most one monitor in a row would fail to map: two that time out back to back outlast fifteen seconds, and any screensaver-class window from elsewhere could keep a dead launch going. The launcher now reports before each monitor, and the deadline counts from its last report: each monitor costs at most its five-second wait, so fifteen seconds without one means the launcher has stopped, however many monitors there are, and windows the launcher did not open no longer extend it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: muse-spark-1.3-contributor High <noreply@meta.com>
|
Reviewed at a9b0a4c. Nothing is left to act on; what remains is the maintainer's call between this and the competing approaches listed in the description. Since the supersede. Four commits on top of Eryk's and the late-map fix:
What ran. Everything below ran on a disposable worker built from the Omarchy ISO, with this branch linked as the running shell and real input from a uinput device:
Second opinion. Codex Medium and muse-spark-1.3-contributor High reviewed every round. The late map, the stale-count path, mid-launch arming, a killed launcher and multi-monitor timing were all theirs or Greptile's, and each is fixed above. One remains noted, not changed: a single monitor iteration can outlast 15 s only if Hyprland takes seconds to answer each of several Not covered. Real multi-monitor hardware (simulated with timed windows), Bluetooth input, and whether the hidden cursor comes back (it can't be read through Waiting on. The maintainer. |
|
Superseded by #16800, now merged. The screensaver is a native Wayland overlay that dismisses itself on any key, click, scroll or mouse movement, so the terminal-side input monitoring this added is no longer needed. |
The screensaver only closes on a keypress inside its own terminal, or when it loses focus. Moving the mouse, clicking or scrolling over it does nothing, so on a desk the first instinct to wake the machine leaves the screensaver up. Closes #7762.
This dismisses it on any seat input, using the compositor's input notifications rather than anything inside the terminal. A one-millisecond
IdleMonitorruns only while a screensaver window is mapped. It ignores inhibitors, so a playing video does not keep a manually started screensaver up. On its first input after arming, it closes the screensaver the same wayomarchy-screensavercloses itself, and the screensaver's own exit trap restores the cursor. Hyprland never resumes a zero-timeout notification, hence one millisecond.Input arms only once a launch is over, so the click or keypress that launched the screensaver, and the launcher's focus walk across monitors, cannot close it while the rest are still opening.
omarchy-launch-screensaverreportsscreensaverLaunchingbefore each monitor andscreensaverReadyonce every window has mapped and focus is back; input arms 500 ms after that. A screensaver that opens outside a launch arms on its own after 500 ms: one that mapped after the launcher stopped waiting for it, or one already up when the shell starts. A launcher killed mid-launch never reports ready, so fifteen seconds without a report ends the launch: each monitor costs the launcher at most its five-second wait, whatever the monitor count.The service counts screensaver windows from the live toplevel list (
ToplevelManager, filtered on the screensaver's app id), not from a set built out of Hyprland'sopenwindowandclosewindowevents. The count decides whether activity may cancel a pending lock, so it has to match the windows that exist. A set that missed one close would stay non-empty for good, and a shell started while a screensaver was up would never see it. Wayland reports every close, and a new shell lists the windows already open, so a screensaver started from the menu stays dismissable across idle cycles and shell restarts. That replaces the raw-event handler and the two model helpers that only served it.test/shell.d/idle-test.shnow runs the real idle service against real screensaver windows: one opened before the service starts and one opened mid-launch. It checks that the count follows them, that input arms for the first on its own, and that it stays unarmed for the second until the launch reports ready.screensaver-workspace-test.shchecks that the launcher reports each monitor before opening its screensaver.Because any key now dismisses through the compositor, this likely also addresses #15985, where letter keys are lost while ttfx is drawing.
#16519 covers the click case alone, from inside the screensaver script. #7528, #12975, #11746 and #16235 are other approaches to the same problem.
Reviewed by Claude Opus 5.5, with Codex Medium and muse-spark-1.3-contributor High as second opinions. On an Omarchy ISO worker, uinput mouse movement, a click, a scroll and a letter key each dismissed the screensaver, whether it was launched from the menu, launched by idle, or still up across a shell restart. An idle dismissal cancelled the pending lock. A screensaver opened mid-launch stayed up through mouse movement until the launch reported ready. A launch that stopped reporting armed after fifteen seconds. Alacritty, Ghostty, Kitty and foot screensaver windows were each counted on the hidden special workspace. On the base branch the same mouse movement left the screensaver up.
Supersedes #16549 by @erykwieliczko, whose commits this carries unchanged, with the fixes above on top.