Repository navigation
Wake the blanked lock screen from the keyboard - #7471
notTanveer wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates the lock screen’s password input behavior to request focus by default.
Changes:
- Forces focus onto the password
TextInputby settingfocus: true.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| verticalAlignment: TextInput.AlignVCenter | ||
| horizontalAlignment: TextInput.AlignHCenter | ||
| activeFocusOnPress: true | ||
| focus: true |
There was a problem hiding this comment.
the lock screen component only has a text input field. there are no other focusable controls.
8293a60 to
9e1b3f3
Compare
| } | ||
|
|
||
| function runWake() { | ||
| displayBlanked = false |
There was a problem hiding this comment.
Correct, and worse than the flag being stale: omarchy-brightness-display on skips its dispatch on purpose when every active display already reports DPMS on, so the raced wake is not just early, it is a no-op. The blank then took the panel down behind it and left the monitor gated off by displayBlanked — disarmed against exactly the screen it exists to wake.
Serialized in 7d6cb90. runWake() holds the wake back while blankProcess is running, and the blank dispatches it from its own onExited, where the DPMS off it has to undo has actually landed. Covered by test/shell.d/lock-blank-wake-test.sh.
|
Re-reviewed at 9e1b3f3 after the rewrite. The earlier version of this branch was the one-line The mechanism works, proven by mutation. On a disposable VM running this branch as the live compositor, I severed every route to With the Two limits on what that VM can show, both worth having. Its virtual output does not lose keyboard focus on DPMS-off, so #7467 itself does not reproduce there — I could confirm the mechanism, not the cure. And with the shell's every wake route severed, One defect found and fixed, pushed to this branch as 245dded. The idle notification starts active and only reports idle after a second of quiet, and any input restarts that second. Armed only while blanked, it was deaf to precisely the user this is for: someone who looks back at a just-blanked lock screen and types their password straight in never leaves the gap the notification needs to prime. Same harness, measured: 47 keystrokes over 15 seconds, no wake at all; then a three-second pause and one more key, wake. Arming it for the whole lock and gating the wake on Two things left open, for the maintainer rather than for me:
Related work. #7592 and #7164 fix the focus half by other routes — #7164 refocuses when Second opinion. Codex at xhigh reviewed this independently and got to the priming hole before I did: I had reasoned about the arming condition and the flag race but not about the notification starting active, and its reading is what sent me to measure the thing. That finding stands on its own. It agreed on the flag/DPMS race, and on that point its independence is not currently guaranteed. It found no conflict between this monitor and the one in Tests. On the worker, against the pushed commit: the full Waiting on the maintainer to choose between this and #7592/#7164/#6642, and on you for the refocus timing if you can still reproduce it. |
|
Both open items are fixed, and the priming finding in 245dded is a good catch — that one would have shipped broken for the exact user the PR is for. The refocus timing. You read it right: the flag clears at the top of That is the same shape as #7592, minus the blanked gate. Noted in the description: if #7592 lands first, the timer here should go and only the The flag/DPMS race. Fixed in 7d6cb90, and the mechanism is a little sharper than "the wake may observe a lit display": Tests. Not re-traced live. The shell on the affected machine runs from the packaged tree, so neither fix has been re-traced there yet — they are reasoned from source and covered by that test. Worth a live trace before merge if the refocus timing is what decides it; I can still reproduce the original blanked-lock deadlock here. On your VM's second observation — Hyprland lighting the panel itself on input, with every shell wake route severed — that matches what I see: the display coming back is not the hard part, the focus is. If that holds generally, then yes, the refocus is what decides #7467, and the wake here is what makes it deterministic rather than dependent on the compositor doing it. |
|
Re-reviewed at e5b5567. Both open findings are fixed, and both fixes are now traced on a live compositor rather than reasoned from source: a disposable Omarchy VM running this branch as the session shell, with a 7d6cb90 — the wake/blank race. Fixed, and it was worse than either of us wrote down.Reverting only the two lines of 7d6cb90 and pressing a key 145ms into the blank: With the gate back in, same harness, key 28ms into the blank: So the mechanism is exactly as you described it: The part worth adding is that Authentication succeeded, the lock went away, and the screen stayed black. Fixed, same timing: That failure predates this PR — e5b5567 — the refocus retry. Fixed.The VM's virtual output never loses keyboard focus on DPMS-off, so I took it away by hand instead: an instrumented Three for three, 101ms each, which is the timer's own interval. With the timer removed and the same drop, One thing still open, and it is the same terminal state by a narrower routeCodex at xhigh, asked to enumerate the interleavings at this head, worked out that onExited: if (!root.displayBlanked && !wakeProcess.running) wakeProcess.running = true
Dark screen, flag false, monitor disarmed — the state 7d6cb90 exists to prevent, five seconds long on the lock screen. On the unlock path there is no re-arm, and it is the black desktop above. The precondition is a wake still running five seconds after it started, which is narrower than what this PR fixes, so this is not a regression: I have not pushed a fix. The obvious one is a pending-wake latch drained from both processes' exits, but SequencingYour read of #7673 is right and it is the sharpest conflict here: it replaces On #7592: it is the same timer minus TestsOn the worker, at e5b5567: Codex also noted that the new test only matches source text: it would still pass if an unconditional wake were added before the guard, or if the This review was done by Claude Opus 5 with a second opinion from Codex at xhigh. Where codex agreed with conclusions already reached — the DPMS-skip mechanism, the refocus wiring — its independence is not currently guaranteed and I am not claiming it. The dropped-wake analysis is its own, and the traces above are mine. Waiting on the maintainer for the sequencing against #7673 and #7592, and on you for whether the dropped-wake case is worth closing here or after #7673. |
ad9f6f1 to
f45829d
Compare
- Watch compositor input with an IdleMonitor so a key wakes the blanked lock screen without keyboard focus - Arm the monitor for the whole lock so it is already idle when the blank lands - Hold the blank while the monitor still sees input the password field never heard - Refocus the password field when the display comes back - Add a test pinning the monitor and the blank gate
- Hold back a wake that arrives while the blank process is still running - Run the held wake when the blank process exits, once its DPMS off has landed - Pin both in the blank wake test
- Replace the one-shot refocus with a timer that retries until the password field has focus - Idle the timer while the display is blanked or a password check is running - Pin the retry timer in the blank wake test
f45829d to
55bbb88
Compare
The blank's exit read a cleared displaysBlank as a wake held back mid-blank, but onScreensChanged clears that flag too. An output coming or going during the blank, as a connector that drops on DPMS off does, made the exit dispatch omarchy-system-wake nobody asked for, and with the blank timer already spent the lock then stayed lit until the next input. Record the held wake in its own flag instead, and let a later blank request supersede it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Re-reviewed after the rebase onto What ran, and where. Everything ran on a disposable Omarchy VM, with this branch linked as the live shell. The VM's virtual output keeps keyboard focus through DPMS off, so #7467 does not happen there on its own. To reproduce it, an instrumented
A second output did not make the refocus timer spin: both lock surfaces held The defect, fixed in 2ef9433. Which fix for #7467. Hyprland already lights the panel on a keypress, so what #7467 is actually missing is focus. A focus-only fix covers it:
What this branch adds on top is real: it keeps the shell's state in step with a wake Hyprland did on its own (keyboard backlight, the blank countdown, a video wallpaper), and it closes the blank/wake race. That race predates this pull request and can leave even the unlocked desktop dark until the next input. But it is a change to wake state and blank/wake ordering, not a fix for the missing focus, and it would read better as its own pull request. It also conflicts with #7673, which deletes the Hardware. Whichever fix lands needs confirming on a machine that loses focus on DPMS off. #7467 was opened by this pull request's author, so that confirmation has to come from someone else: the reporter of #12587, or a maintainer. Second opinion. Codex at medium reviewed three rounds. In the first it found the screen-change interaction above, and in the second the superseded held wake. It is credited as co-author on 2ef9433, and its last round on that head found nothing blocking. Asked separately which of the competing pull requests best fixes #7467, it put #8560 first, #7592 second and this one third. It got there independently of the ranking above, though it could not read #10944, #11858 or #9523's diffs. Where it agreed with a conclusion already reached, its independence is not guaranteed. Waiting on the maintainer: which focus fix to take for #7467, and whether the wake-state and ordering half of this branch should come back as its own pull request, sequenced against #7673. |
Fixes #7467
all this so i don't have to reach for my mouse and do a click.
what's broken
5s into the lock the screen blanks, and
omarchy-brightness-display offdoes a real DPMS off. hyprland takes the lock surface's keyboard focus with it and doesn't give it back when the panel comes back on.the keyboard's only way into the lock is the password field's
Keyshandler, which needs that focus. hyprland lights the panel on a keypress by itself (key_press_enables_dpms), but the shell never hears the key, sorunWake()doesn't run and nothing gets typed. a click works because pointer events don't care about keyboard focus, which is why plugging in a mouse fixes it in the issue.the fix
wake from the compositor, where focus doesn't matter (
Service.qml):it's armed for the whole lock, not just while blanked. the idle notification starts active and only goes idle after 1s with no input, so one armed at blank time never primes if you look back and type your password straight in. i measured that with every other wake path cut: 47 keys over 15s, no wake.
it uses the
displaysBlankflag that's already on quattro.then get focus back (
LockView.qml): a short timer keeps callingforceActiveFocus()until the field hasactiveFocus, and does nothing while the display is blanked.the blank timer also won't blank while the monitor still sees input. it only restarted on input the field hears, so with no focus you could be typing and it would blank under you, with nothing left for the monitor to wake on until you paused.
commits
runBlank()turns the keyboard backlight down before the DPMS off, so a wake in that gap ran against a lit display,brightness-display onskipped it (on purpose, to avoid a flash after resume), and then the blank turned the panel off behind it. now a wake that shows up while the blank is running waits for the blank to exit.displaysBlankas a held wake, butonScreensChangedclears it too, so an output coming or going mid-blank lit the lock with no input. the held wake has its own flag now,wakeHeld, and a laterrunBlank()drops it.other open PRs
blankProcess/wakeProcessforexecDetached, and the wake hold above needsblankProcess.runningandonExited. if it lands first i'll redo that part, probably as a settle timer.flockinomarchy-brightness-displaylooks like the obvious fix that survives Stop a wedged blank or wake child from silently disabling the lock screen's display control #7673, but it doesn't work. the blank is slowed down byomarchy-brightness-keyboard off, so the wake gets the lock first, sees a lit display, skips, and then the blank turns it off. holding the lock across the whole blank gets the order right, but then one stuck blank holds every wake on the system, which is the thing Stop a wedged blank or wake child from silently disabling the lock screen's display control #7673 is fixing.LockView.qml, and both merge clean with this branch. if one of them lands and covers the DPMS path, the timer here can go and this is just theService.qmlhalf.verification
traced on the machine that hits the issue, with temp logging around blank/wake, before the rebase. blanked, then woke it with the keyboard only:
test/shell.d/lock-blank-wake-test.shpins the monitor, the blank gate, the wake hold and the retry timer (6 checks), and all thelock-*tests pass at 2ef9433. i didn't rerun the full./test/shellon 2ef9433. at 55bbb88 it failed the same tests as plain quattro (runtime-smokeis flaky there too), and omarchybot's VM run at 2ef9433 says the same.since the rebase omarchybot traced the keyboard wake, the wake hold and the refocus on a VM at 2ef9433, traces are in the thread. the VM keeps focus through DPMS off, so it had to drop the field's focus by hand to get the issue. the blank gate hasn't been traced live at all, and none of this has been re-traced on the machine that actually hits it since the rebase.