Repository navigation
Conversation
mklasen
force-pushed
the
touch-dismiss-screensaver
branch
2 times, most recently
from
August 19, 2026 18:26
a06e54d to
28e2fb1
Compare
mklasen
force-pushed
the
touch-dismiss-screensaver
branch
from
August 19, 2026 18:36
28e2fb1 to
c6d91ab
Compare
…cluded The screensaver's loop only exits on a byte from stdin or a change of focused window class, so only a keypress dismisses it. Touch, pointer motion and clicks produce neither: a click on the fullscreen screensaver does not change focus, and the mouse-tracking escapes that used to catch motion were removed in d2ea6ad. The main idle monitor cannot cover this. Launching the screensaver focuses the new window, which registers as activity, so isIdle goes false about 300ms after the screensaver appears and never changes again while it is displayed. Arm a second idle monitor for as long as a screensaver is on screen, however it was started. It settles once the launch activity passes, and the next seat input dismisses. ext-idle-notify is compositor-side, so one path covers keyboard, touch, touchpad, clicks and bluetooth mice. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mklasen
force-pushed
the
touch-dismiss-screensaver
branch
from
August 19, 2026 18:36
c6d91ab to
0521dfb
Compare
Owner
Author
|
Superseded by omacom#7528 — same branch, opened upstream. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dismiss the screensaver on touch and pointer input, bluetooth mice included
bin/omarchy-screensavercan only be dismissed by a keypress. Touch, pointer motion and mouse clicks are all ignored. On a convertible in tablet mode there is no way to dismiss it at all — and touch is delivered into the screensaver terminal, so you can tap, scroll and select text in it while it is displayed.The dismiss loop has exactly two exits (
bin/omarchy-screensaver:43-47):read -n1 -t 1needs a byte on stdin — a keypress.! screensaver_in_focusneeds the focused window class to change. A click on a fullscreen screensaver that already has focus produces neither, and pointer motion produces neither since the mouse-tracking escapes were removed in d2ea6ad.The fix
Arm a second
IdleMonitorfor as long as a screensaver is on screen. It settles once the launch activity passes, and the next seat input dismisses.ext-idle-notifyis compositor-side and device-agnostic, so one path covers keyboard, touch, touchpad, clicks and bluetooth mice — the terminal and per-device escape sequences are not involved at all. The state machine lives inIdleModel.jsas a pure function alongside the existing helpers, sotest/shell.d/idle-test.shcovers it.No change to
bin/omarchy-screensaver: itstrapalready tears down in the right order, and the existingclosewindow→handleScreensaverWindowClosed()path already cancels the pending lock and runs wake.On the d2ea6ad revert
The revert reason was "Could not get it to stop existing with a Logitech MX4 when connected via bluetooth." That failure was specific to the approach: omacom#3723 made the terminal watch for mouse reports (
\e[?1000h\e[?1003h), which is client-side and device-dependent. This never involves the terminal, and is verified here with a Logitech MX Master 3S over bluetooth.Caveats
footwhen the finger is still down as the window tears down — a use-after-free in foot 1.27.0, not in this change, though this change makes it reachable. Details below.pkillindismissScreensaver()overlaps with Stop screensavers through their supervisors omacom/omarchy#6813, which reworks screensaver teardown into per-supervisor ownership. The detection half (the second monitor) is what is missing today and composes with whatever lands there.Why this cannot be fixed in
handleActiveSignal(), or by polling the pointerThe main
IdleMonitoris alreadyactivefor the whole time the screensaver is displayed and never signals again. Launching the screensaver focuses the new window, which the compositor reports as activity. Every cycle, from the shell's own log:That blip is what the
screensaverLaunchGraceTimerguard already absorbs. The control case confirms the cause: when the session is already locked,omarchy-launch-screensaveris skipped by theisLockedguard and noidle-monitor: activefollows.So
isIdleisfalsebefore the user touches anything and staysfalse; a new branch there would be unreachable.Polling the pointer does not work either. Touch never moves it: across 1248 touchscreen events over 5.5s,
hyprctl cursorposdid not change once, while a touchpad drag tracked it sample-for-sample.cursor:hide_on_touchdefaults to true and Hyprland routes touch throughwl_touch, separate from the pointer.Testing
./test/shell— 4 new assertions intest/shell.d/idle-test.sh; 181/184 files pass. The 3 failures (config,snapper,unowned-system-paths) reproduce identically on a clean checkout here and are environment-specific.Verified in the running UI per
agents/skills/visual-verification.md, running the checkout viaomarchy dev link. Raw evdev correlated against the shell's own journal:270ms from finger to dismissal:
Also covered:
system.screensaver→omarchy-launch-screensaver force), i.e. outside any idle cycle — dismissal works, which is whyscreensaverVisiblekeys offscreensaverWindowCountrather than the idle-cycle flags.hyprctl output create headless,omarchy-launch-screensaverstarts one instance per output and dismissal tears down both.Environment: Acer Spin SP313-51N (Wacom HID 49AF Finger touchscreen), Hyprland 0.56.2, foot 1.27.0.
Known limitation, inherited rather than introduced: the service learns about screensaver windows from
openwindowevents, so a screensaver already on screen when the shell restarts is not tracked and will not arm the dismiss monitor.The foot use-after-free, in detail
Symbolized, and identical across three independent crashes:
wayl_win_destroy()does awl_display_roundtrip(), which dispatches still-queued Wayland events — and a pendingwl_touch.upthen runswl_touch_up()against the window being freed.In one run the two crashes land 1.4s and 0.9s after the two held-touch dismissals and nowhere else, while a tap held 0.05s dismissed cleanly in the same run.
Dismissal is issued about 270ms after finger-down, so a normal tap is already clear of the window and only a held touch hits it. It is a race rather than a certainty — it depends on whether a
wl_touch.uphappens to be queued when the roundtrip runs — but a held touch loses it reliably in practice.Not worked around here, because a timing delay would only narrow the race rather than close it. Note also that omacom#7193 replaces the foot-based screensaver with a native Wayland client, which would remove this exposure entirely.
Teardown ordering, and why the pkill pattern looks like that
dismissScreensaver()signals the screensaver script, not its terminal, so the script'straprunsexit_screensaverand stopsttfxbefore the terminal closes. Closing the terminal first takesttfx's pty with it andttfxaborts — the same failure as omacom#6762 / omacom#6764.The terminal's own command line also ends in
omarchy-screensaver(foot … -e omarchy-screensaver), so the pattern requires thebashprefix to avoid matching both and killing them simultaneously.omacom#7193 is unaffected by this change: it execs an externally packaged binary and does not alter dismissal logic in this repo. A fix at the idle-service level is implementation-independent, though the stop command would need to cover the native client too.
Diagnosis and patch developed with AI assistance (Claude), verified on hardware.