Repository navigation
Conversation
0ddddb3 to
194e57c
Compare
The lock service blanks the display with a one-shot five-second timer that is re-armed only by input reaching the lock surface or by a password check finishing. Hyprland lights DPMS on its own for any pointer motion or key press (mouse_move_enables_dpms, key_press_enables_dpms), and when that input produces no event on the lock surface - one stray sensor count from a mouse at 03:29, in the captured case - the spent timer stays spent and the panel is on until someone touches the machine. On an OLED that is the lock screen burning in overnight. Listen to ext-idle-notify while locked, the protocol the idle service already uses, and re-arm the blank on every resume unless a password check is in flight. Inhibitors are not respected here on purpose: a monitor that respects them treats one appearing as activity, which is the wake omacom#9152 proposes removing from the idle service. The monitor's timeout is shorter than the blank countdown so it is already idle by the time the display goes dark and the next input is a transition it reports. The change never runs the wake and never shortens anything, so the worst a spurious resume can do is delay a blank by five seconds; slow panels are no worse off than before. Log the blank when its process starts and the re-arm when the timer was spent, and expose blankArmed and activityIdle on `omarchy-shell lock status`; until now the shell logged nothing about display state at the lock screen. The five-second budget and the monitor re-add after an HPD drop (omacom#7749, omacom#8580) are separate defects and untouched.
|
One gap in the "cannot strand a display" enumeration, from a clamshell machine - though having tested it, the gap argues for this PR rather than against it. The list of independent owners assumes the output is still there to be lit. In clamshell (lid shut, external only, Then:
So the owners that remain are exactly the ones this PR removes. What that does not mean is that keeping the idle service's wake would rescue this state. What this state wants is an owner of its own - something that re-applies a mode ( |
The lock service blanks the display with a one-shot five-second timer that is re-armed only by input reaching the lock surface or by a password check finishing. Hyprland lights DPMS on its own for any pointer motion or key press (mouse_move_enables_dpms, key_press_enables_dpms), and when that input produces no event on the lock surface - one stray sensor count from a mouse at 03:29, in the captured case - the spent timer stays spent and the panel is on until someone touches the machine. On an OLED that is the lock screen burning in overnight. Listen to ext-idle-notify while locked, the protocol the idle service already uses, and re-arm the blank on every resume unless a password check is in flight. Inhibitors are not respected here on purpose: a monitor that respects them treats one appearing as activity, which is the wake omacom#9152 proposes removing from the idle service. The monitor's timeout is shorter than the blank countdown so it is already idle by the time the display goes dark and the next input is a transition it reports. The change never runs the wake and never shortens anything, so the worst a spurious resume can do is delay a blank by five seconds; slow panels are no worse off than before. Log the blank when its process starts and the re-arm when the timer was spent, and expose blankArmed and activityIdle on `omarchy-shell lock status`; until now the shell logged nothing about display state at the lock screen. The five-second budget and the monitor re-add after an HPD drop (omacom#7749,
The idle service runs omarchy-system-wake whenever its idle monitor reports activity during a cycle it started. While the session is locked that is the wrong reflex: the lock screen already lights the panel for input that reaches it and blanks it again five seconds later, and the idle monitor resuming is not evidence of input there. Hyprland makes the monitor resume with nobody at the machine: it re-checks idle inhibitors whenever one is created or destroyed and whenever a window maps, unmaps or takes focus, and every re-check restarts inhibitor-aware timers and sends "resumed" to an idled one (IdleNotify.cpp, setInhibit() -> update() -> reset()), whether or not anything ends up inhibited. So a video starting, a browser taking a wake lock on a background workspace, or any window opening or closing behind the lock counts as activity, the panel lights, and nothing blanks it again - on an OLED that is the lock screen burning in overnight. Reading the lock state in-process no longer reaches the lock: since 1702cf0 the auth services live in AuthServiceStore and are never published to ShellRoot._services, so firstPartyServiceFor("omarchy.lock") returns null and the guard the original version of this change added always read unlocked. Ask the compositor instead, at wake time, through omarchy-hyprland-session-locked - the same helper omarchy-restart-shell and the lock service's stranded check use. Locked (exit 0) the wake skips itself with exit 75, which the process exit handler logs as "wake-skipped: session-locked"; unlocked and undetermined wake exactly as before. The cycle itself still ends; only the display is left alone. The fixture test stubs only that boundary now: omarchy-hyprland-session-locked answers from a file the fixture flips, omarchy-system-wake records a run instead of lighting a display, and the real Service.qml drives all three compositor answers. The old fixture registered a fake lock straight into _services - the registry this change no longer reads - so it stayed green on a dead feature; its unit cases and source-text assertions went with it.
|
Reworked and rebased onto |
194e57c to
4097f02
Compare
|
This pull request was not reviewed in this pass, and nothing from it was run. Omabot classifies every item with two models before working it: Claude Opus 5.5 reads this as a bug fix, but the second opinion (Codex Medium) could not be asked, because the day's budget of reviewer calls was already spent. With only one model's reading the classification is unsettled, so the review, the reproduction on a worker and the test run all wait for it rather than going ahead on one opinion. Nothing is needed from you. The next pass with reviewer budget left classifies it again at this head (4097f02) and works it from there. |
|
Same sequence on Omarchy 4.0.4-1, Hyprland 0.56.2, Quickshell 0.3.1-1, Framework Laptop 13 AMD Ryzen AI 300, laptop panel plus a USB-C OLED. Locked since 19 Oct 23:39 PDT. At 20 Oct 01:16:49 PDT the idle monitor started a cycle while already locked, the screensaver command exited 0 immediately, and at 01:17:47 it logged That matches the wake this PR skips. I have not applied it yet. |
What happens
Lock the session and let the lock screen blank the display. Later the panel comes back on at the lock screen with nobody at the machine, and stays on until someone touches the keyboard or mouse. On an OLED that is the lock screen burning in for hours.
omarchy debug idleshowsidle-monitor: active→idle-cycle-cancel: activity→process-start: wake omarchy-system-wake, while an evdev witness on every input device saw nothing all night.Why
The idle service treats its
IdleMonitorresuming as user activity and runsomarchy-system-wake. That monitor respects inhibitors, and Hyprland resumes inhibitor-aware idle notifications without any input: it re-checks idle inhibitors whenever one is created or destroyed and whenever a window maps, unmaps or takes focus, and every re-check restarts those timers and sendsresumedto an idled one (src/protocols/IdleNotify.cpp:setInhibit()→update()→reset()), whether or not anything ends up inhibited. So a video starting, a browser taking a wake lock on a background workspace, or any window opening or closing counts as activity.Unlocked that is harmless. Locked it lights the panel, and the lock screen only re-arms its blank for input that reaches its own surface, so nothing blanks it again.
Fix
While the session is locked the display belongs to the lock screen, so the wake asks the compositor first:
cancelIdleCycle()runsif omarchy-hyprland-session-locked; then exit 75; else omarchy-system-wake; fi, and the wake's exit handler logs 75 aswake-skipped: session-locked. Unlocked or undetermined, it wakes exactly as before, and the cycle ends either way.omarchy-hyprland-session-lockedis the helperomarchy-restart-shelland the lock service's stranded-lock check already use.The first version of this PR read the lock state in-process through
shell.firstPartyServiceFor("omarchy.lock"). Since 1702cf0 the auth services live inAuthServiceStoreand are never published toShellRoot._services, so that lookup returns null and the guard always read unlocked: on a live machineomarchy-shell idle statussaidsessionLocked: falsewhileomarchy-shell lock statussaidlocked: true, secure: true, and the panel woke behind the lock. Its fixture registered a fake lock straight into_services, so its test stayed green on a dead feature. This version drops the in-process lookup, thesessionLockedstatus field andIdleModel.wakeAfterIdle.Why this layer, unchanged from the first version: re-blanking in the lock screen would still flash the panel; refusing inside
omarchy-system-wakewhile locked would break the lock's own wake, which runs the same command; andrespectInhibitors: falsewould bring the screensaver back over video playback.Proof
Nested Hyprland 0.56.2 with a real
WlSessionLockheld on it, the real idleService.qml(screensaver after 5 s), and the realomarchy-system-wake,omarchy-brightness-displayandomarchy-hyprland-session-locked. The trigger is afootwindow opening and closing, with no input at all.idle-cycle-cancel: activity→process-start: wake omarchy-system-wake, and DPMS goes from off to on behind the lock.wake-skipped: session-locked, and DPMS stays off.Tests
test/shell.d/idle-lock-wake-test.shreplaces the old fixture. It loads the realService.qmlin a throwaway quickshell and stubs only the boundary:omarchy-hyprland-session-lockedanswers locked, unlocked or undetermined, andomarchy-system-wakerecords its runs. The wake runs for unlocked and undetermined and never while locked. Against the first version it fails. The existing idle and lock tests pass.