Repository navigation
Don't treat pointer motion right after an output change as lock-screen activity - #10343
johnkattenhorn wants to merge 1 commit into
Conversation
…n activity A monitor that deep-sleeps on DPMS-off drops its link a couple of seconds after the lock blanks, then re-handshakes and returns. Rebuilding the lock surface for the returning output can deliver synthetic pointer motion to LockView's MouseArea, which counted as user activity: runWake() lit every display and re-armed the 5s blank, closing a wake/blank loop that runs for as long as the session stays locked (~10s period measured; 4,182 hotplug cycles logged in a single day, and each one re-sends dmabuf feedback to every Wayland client, which crashes GTK4 apps under gtk4 4.22.x's dmabuf munmap bug). Give pointer motion its own signal and gate it: motion within 10s of a screens change re-arms the blank, so a monitor that comes back lit goes dark again, and does not wake the desk. Clicks and keys are deliberate and keep waking immediately. Complements omacom#9152 (idle service side) and omacom#8581 (re-blank of returning monitors); addresses the wake half of omacom#8863/omacom#8689/omacom#8580 for wake vectors that fire later than the 1.5s post-blank debounce in omacom#8896 covers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V7dqWeWCgwYfUR3xEV6vT2
|
Reviewed against Another open pull request is the better fix for this bug: #13129. This pull request stops pointer motion within 10s of a screens change from waking the lock. Instead, that motion re-arms the blank timer. That keeps the other displays dark, but it does not stop the hotplug. Trace one cycle through The 10s gate also applies to any screens change, not only one the blank caused. Someone who docks or plugs in a monitor while locked and then moves the mouse gets no wake from the lock for 10s. Clicks and keys still wake. The test only matches the new source text with regular expressions, so it would pass whether or not the gate stopped anything. The branch also conflicts with The other open fixes aimed at this cluster are #8896, #8581, #9152 and #10130. Like this one, they all act on the lock or idle service after the output has already come back. The Waiting on the maintainer to choose between this and #13129. |
What happens
A monitor that deep-sleeps on DPMS-off (many Dell/ViewSonic/BenQ panels) drops its link a few seconds after the lock screen blanks, then re-handshakes and returns. Hyprland re-adds the output lit, the lock surface is rebuilt for it, and the rebuild can deliver synthetic pointer motion to
LockView's full-surfaceMouseArea. That motion counted as user activity:runWake()lit every display and re-armed the 5s blank, closing a wake/blank loop that runs for as long as the session stays locked.Measured on an AMD Cezanne APU with dual Dell 4K monitors on HDMI (Omarchy 4.0.2-1, Hyprland 0.56.2): ~10s period, from lock at 21:29 to unlock at 07:11 without a break — 4,182 hotplug cycles in one day. Related reports: #8863, #8689, #8580, #8946.
Beyond the visible light show, every cycle re-sends
zwp_linux_dmabuf_feedback_v1to all Wayland clients, and gtk4 4.22.x's dmabuf munmap bug (fixed on GTK master in a8a5692c, not backported to gtk-4-22) turns each one into a crash roll — this machine collected 12 ghostty and several nautilus coredumps in a week, symbolized to exactly that GTK frame.Why not a time-since-blank debounce
#8896 debounces unforced wakes for 1.5s after the blank, which covers vectors that fire immediately. But the link drop lands at ~2s here, ~11s on a Navi 32 report in #8863, and ~19s in #8580 — a blank-relative window has to be very long to cover the spread, and a long window swallows real users. The output change itself is the reliable anchor: whenever the drop happens, the synthetic motion arrives right after the screens change.
Fix
LockViewgains a dedicatedmotionWakeRequested()signal; pointer motion emits it, while clicks and keys stay onwakeRequested().lastScreensChangeAton everyQuickshell.onScreensChanged.This closes the lock-surface wake vector. It deliberately composes with, rather than replaces, the in-flight work on the neighbouring vectors: #9152 (idle service waking a locked session's display) and #8581 (re-arming the blank for returning monitors with backoff). On the hardware above, the journal evidence shows both the lock-surface and idle-service vectors firing; both fixes are needed for a fully quiet night.
Tests
test/shell.d/lock-motion-wake-gate-test.shasserts the signal split, the stamp, the gate, and that the deliberate-input paths are untouched. Existing lock tests pass.🤖 Generated with Claude Code