Repository navigation
Keep screensavers open while the launcher moves focus between monitors - #15243
juan-LARRAYA wants to merge 4 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
[Medium impact] The PR appears safe to merge; no blocking issues remain. SummaryThe launcher writes a temporary PID marker while moving focus between monitors. Screensavers skip focus-based dismissal only while that PID is alive.
Reviews (4) · Last reviewed commit: "Make the interrupt case wait for the spa..." · Reviewed by Greptile |
… launcher Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The spawn sentinel from the first launch was still on disk, so the wait could end as soon as the marker appeared and signal the launcher before it spawned anything or reached its wait for a window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
The bug is real, and this fixes its cause. I tested it on a disposable Omarchy worker running this branch merged onto current I pushed one commit to your branch, 19313cb. The interrupt case could signal the launcher before it spawned anything: the spawn sentinel from the first case was still on disk, so the wait stopped as soon as the marker appeared. It now clears the sentinel and requires a fresh spawn before sending SIGTERM, so it tests an interrupt during the wait for a window. I also linked #8114 and #14377, which describe the same failure. Second opinion: Codex Medium reviewed it in two rounds and found nothing open on this head. Independence is not guaranteed. It found the sentinel problem in the test. It also raised two edge cases that are left as they are, because neither makes things worse than
Other open fixes in this area:
Codex, asked separately which of these to bring forward for this bug, chose this one for the same reason. The full shell suite is not green on the worker, and this branch did not cause that: it has the same failures on |
|
This now conflicts with The native screensaver can't hit this bug. It is one process that puts an overlay layer surface on each output as the output appears, with no per-monitor spawn or deadline. A keyboard focus leaving a surface is explicitly not treated as a dismissal: in omacom/omarchy-screensaver, Second opinion: Codex Medium and muse-wonder (High) each read Thank you @juan-LARRAYA. Your diagnosis of the launcher's focus walk was right, and the replacement avoids that walk entirely. This waits on the maintainer, and I recommend closing it as superseded by #16800. If you can still make a screensaver close itself on several monitors with the native one, please open a new issue against it. |
Cause
omarchy-launch-screensaverfocuses each monitor in turn and waits for its screensaver to map. Until it does, a foreign toplevel is the active window. A screensaver already running on an earlier monitor pollshyprctl activewindowonce a second, reads that as the user clicking away and callsexit_screensaver, whosepkill -f '[o]rg.omarchy.screensaver'also kills the terminal still starting on the next monitor. That monitor never emitsopenwindow, so the launcher waits out its 5 s deadline (the capture in the issue). A slower terminal widens the gap, and raising the deadline would not help because the window it waits for is already dead.#7102 (latch) does not cover this: the earlier instance has already latched focus, so losing it still exits (see the comment there). #13475 only ignores missing focus for a fixed 5 s per instance and targets the panel case.
Change
The launcher writes its pid to
$XDG_RUNTIME_DIR/omarchy-screensaver-launchingwhile it steps through monitors and removes it on exit, including INT/TERM (trap).omarchy-screensaverskips the focus check only while that pid is alive, so a marker left by a killed launcher is ignored. Keypress dismissal and the focus check after launch are unchanged.Testing
test/shell.d/screensaver-launching-test.shruns the real launcher and watchdog against stubs (hyprctl,socat,pgrep,ttfx,pkill): the launcher sets the marker while spawning and clears it on completion and on SIGTERM; the watchdog survives a foreign active window while the launcher is alive, but not with a dead launcher's marker or no marker. Fails on the base and on the previous revision of this PR (interrupt case), passes now.test/shell.d/screensaver-workspace-test.shandsystem-lock-test.shpass.Fixes #9713
🤖 Generated with Claude Code
Fixes #8114
Fixes #14377