Repository navigation
Dismiss the screensaver on any input, not just a keypress - #7780
husamemadH wants to merge 1 commit into
Conversation
The main idle monitor reports activity once while the screensaver maps its own window and then stays active for as long as the screensaver is up, so it never signals again and cannot see the input that should dismiss it. Only the screensaver's own read -n1 loop could, and that needs a byte on stdin while the terminal holds focus. Arm a second idle monitor while a screensaver window is on screen. It arms once input goes quiet, so the launch activity is ignored, and the next input from any device the compositor knows about tears the screensaver down.
There was a problem hiding this comment.
Pull request overview
Adds compositor-wide input detection to dismiss visible screensavers after launch activity settles.
Changes:
- Adds a dedicated dismissal
IdleMonitor. - Adds a pure dismissal-state helper and tests.
- Exposes dismissal state in idle-service status output.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
shell/plugins/services/idle/Service.qml |
Tracks, arms, and dismisses visible screensavers. |
shell/plugins/services/idle/IdleModel.js |
Implements dismissal-state decisions. |
test/shell.d/idle-test.sh |
Tests dismissal-state transitions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
|
||
| IdleMonitor { | ||
| id: screensaverDismissMonitor | ||
| enabled: root.idleEnabled && root.screensaverWindowCount > 0 |
| IdleMonitor { | ||
| id: screensaverDismissMonitor | ||
| enabled: root.idleEnabled && root.screensaverWindowCount > 0 | ||
| timeout: root.screensaverDismissSettleSeconds |
|
Tested successfully on Omarchy 4.0.1 with Hyprland 0.56.2, foot 1.27.0, and two active outputs. The compositor-side Arming must wait until the sequential multi-output launcher has completed. Enabling after the first tracked window lets the monitor settle before the second output maps, so the second mapping can be mistaken for user input. The verified local service gates arming on launch completion as well as The dismissal callback must also reject active-state changes after the idle cycle enters locking. Disabling the monitor at the lock deadline can emit an active-state signal; treating that signal as input tears the screensaver down before #9632's concealed lock handoff is secure and briefly exposes the desktop. The verified guard is: function handleScreensaverDismissSignal() {
if (!root.idledThisCycle || !root.screensaverStartedThisCycle) return
var action = IdleModel.screensaverDismissAction(
root.screensaverDismissArmed,
screensaverDismissMonitor.isIdle,
root.screensaverWindowCount > 0)
// existing handling
}With both guards, two screensaver windows mapped, compositor input dismissed them cleanly, and the later idle-lock transition reached genuine standby without a password or desktop flash. |
|
Automated duplication check: this pull request looks similar to #7528, which covers the same screensaver input dismiss. I keep that one open and close this one to consolidate review. If you feel this is the wrong decision, please open the PR again with a note on the difference. |
Fixes #7762.
Once the screensaver is up, moving the mouse does nothing — it only goes away on a keypress delivered to its own terminal. Pre-Quattro, hypridle's
on-resumedismissed it on any global input.Why the main idle monitor cannot see the input
The screensaver focusing its own window registers as activity, so
IdleMonitor.isIdleflips back tofalsea fraction of a second after launch and then never changes for the rest of the display.onIsIdleChangednever fires again, sohandleActiveSignal()is never reached, and thescreensaverWindowCount > 0guard inside it is not what suppresses the dismissal — the signal simply never arrives.Traced on an affected machine (polling the idle service's own IPC status; the key includes
lastEventAt, so a repeated event would still show):Two cycles in the same run, with the self-inflicted flip landing at 292ms and 295ms after launch. So narrowing that guard would edit unreachable code.
cancelIdleCycle()is also not a teardown: it stops timers and runsomarchy-system-wake, leaving the screensaver window on screen.The fix
A second
IdleMonitor, enabled only while a screensaver window exists. It arms once input has gone quiet — which absorbs the launch activity without needing a grace timer — and the next activity dismisses the screensaver with the samepkillthatomarchy-system-lockalready uses. The existingclosewindow→handleScreensaverWindowClosed()path then cancels the pending lock and wakes the display, unchanged.Because
ext-idle-notifyis compositor-side, this covers keyboard, pointer motion, clicks, touch, and bluetooth devices without the terminal being involved. Manually launched screensavers (omarchy-launch-screensaver force) become dismissable the same way, since window tracking is driven by Hyprland events rather than the idle cycle.The arm/dismiss decision is a pure function in
IdleModel.js, covered bytest/shell.d/idle-test.sh.Verified in the running UI
Same machine, patched service loaded via
omarchy plugin clone omarchy.idle, three cycles:Mouse movement dismisses it immediately; teardown measured at 172ms window-close latency in a 50ms-resolution trace. Lock timing is unaffected — the dismissal monitor is disabled whenever no screensaver window is on screen, and
lockSystem()resets it.Terminal: foot. Hardware: Intel UHD 630 + RTX 2080 Mobile, wired mouse.
Related
IdleMonitor; its state machine and arming differ from this one, and it carries touch-specific findings (including an upstream foot crash) that this PR does not. Reviewers may prefer to land one and close the other.pkillhere is the same callomarchy-system-lockmakes today and should be swapped for whatever lands there.Tests
./test/shell— 2301 assertions pass, 4 of them new; 182 of 185 test files pass. The 3 failing files (config-test.sh,snapper-test.sh,unowned-system-paths-test.sh) all fail on the same missingomarchy-pkgssibling checkout on my machine (omarchy-pkgs checkout found/available for ...) and reproduce identically on a clean tree../test/clipasses.