Repository navigation
Keep the key that wakes a dark lock screen out of the password - #9211
phedoreanu wants to merge 2 commits into
Conversation
b873fe6 to
8fbd1db
Compare
|
Reviewed at 8fbd1db, and both fixes work as described. Nothing to change. I tested it on an Omarchy worker VM running this branch's shell, under Hyprland. I reproduced both problems on the base commit (f38eb42) and checked that this head fixes them:
The lock, sleep, system-lock, video-background and monitor-recovery shell tests pass on the worker, and so does This fixes the wake-key half of #12398. It does not fix that issue's other cause, auto-repeat from the held lock shortcut, so I have not linked it to close. Claude Opus 5.5 did this review. There was no second opinion: the configured reviewer, Codex Medium, refused because its daily review budget was spent. The verdict above is one model's reasoning plus what the worker showed. Until a second review runs, this is waiting on that review and then on the maintainer. |
|
Following the merge of #7806, The merged repeat filter fixes password-field flooding. Automatic wake after resume and consuming the first wake key remain separate work. The reported stale displaysBlank regression also needs fixing; rebasing onto the repeat filter alone is insufficient. Scope checked by GPT-6 in Codex and Codex Medium against the discussion and landed change; review independence is not guaranteed. No tests were rerun for this cleanup. Omabot on behalf of DHH |
|
Rebased onto quattro with #7806 in. The auto-repeat drop keeps its place at the top of the key handler; the wake-key swallow follows it, still judged before the wake clears the state. Automatic wake after resume and consuming the first wake key are the two things left in this PR. The stale |
8fbd1db to
eb7f6db
Compare
[Medium impact] The PR appears safe to merge, with a short remaining window where typing after an outside wake can lose the first character. Findings
SummaryKeeps the key that wakes a dark lock screen out of the password field.
Reviews (6) · Last reviewed commit: "Clear the blank state after outside inpu..." · Reviewed by Greptile |
|
Classified again at Claude Opus 5.5 reads it as a bug fix: the first unlock after resume fails because the key that wakes a dark panel lands in the password field, and the review of Because of that, the new head has not been run on a worker or given a second review yet. The verification in the earlier comment was done at I read the source for Greptile's first finding on the new commit, and the race it describes is real. If a This waits on the maintainer, to decide whether this is a fix or a feature they want. |
|
Greptile's race is closed in the commit just pushed: On fix versus feature: the wake-key swallow is the fix, for the unlock that fails after resume because the key that lights the panel lands in the password field, reproduced on the worker at 8fbd1db. The automatic relight after resume is the part that adds behaviour. If the maintainer would rather take the fix on its own, I will split the relight into a separate PR; say so and it is done. |
|
Tested a port of this to Omarchy 4.0.4 on an ARM Chromebook (Lenovo IdeaPad Slim 3, MediaTek MT8189, s2idle) today:
Thanks for the PR! |
|
Thanks @zoan37, that is a real gap and your fix is in the commit just pushed. The third case you describe, a key that wakes the machine itself and reaches the field once the panel is already lit, is outside what this PR can do: the QML key event carries no timestamp to compare against the resume, and a timed swallow after resume would be a guess, as you found. Left as is. |
|
Classified again at I read the two commits since This waits on the maintainer to decide whether it is a fix, or a feature they want. The author has offered to split the automatic relight into its own pull request, which would leave the wake-key swallow here as a plain bug fix. |
The lock blanks its panels a few seconds after locking. Hyprland turns them back on for any key (key_press_enables_dpms) and still hands that key to the focused password field, so the key pressed only to see the screen became the first password character and the next attempt failed. The view already knows its panel is blank. A key pressed while it is, and the auto-repeats of that key if it is held, now request the wake and are swallowed; the next key is typed. Text an input method commits while blank is dropped the same way, since it never passes Keys.onPressed. A lit lock types every key as before. Same approach as the view change in omacom#9211.
Suspend freezes the shell, so a lock that blanked its panel before sleep still thinks it is blank after resume, even though the panel is usually lit again. The first password key would then be swallowed as a wake key. A one-second timer runs while locked; the first tick after resume sees the wall clock jump and runs the wake, which clears the blank state and re-arms the blank timer. Same as the resume watch in omacom#9211.
732f4dd to
48465d9
Compare
|
Rebased onto current
All |
|
Classified again at I read the rebuilt diff against the source. The branch still merges cleanly with current Two related pull requests touch the same code:
This waits on the maintainer. The choice is whether to take the wake-key swallow as a fix, and whether to take the relight with it or split it off, which the author has offered to do. |
48465d9 to
26a1991
Compare
|
Rebased onto current Two changes in the remaining commit:
|
| Timer { | ||
| id: displayStateTimer | ||
| interval: 3000 | ||
| repeat: true | ||
| running: root.lockRequested && root.displaysBlank | ||
| onTriggered: { | ||
| if (!displayStateProcess.running) displayStateProcess.running = true |
There was a problem hiding this comment.
First password character disappears
Pressing a bound key such as Volume Up wakes the display without calling runWake(). Until the next three-second poll, displaysBlank stays true. Typing a password immediately afterward silently drops its first character, so the correct password fails. Clear the state when that outside wake happens, rather than relying only on the next poll.
There was a problem hiding this comment.
Handled in b9d7c2d for the input cases. A bound key like Volume Up, or the pointer, now clears the blank state once that input has settled for 150 ms without reaching the lock view. A display that arrives while locked clears it too. One case is left, and I explain why in the PR conversation.
|
At I ran the branch under Hyprland on a disposable Omarchy worker and compared it with base
The CLI suite and GPT-6 High in Codex performed the source review and worker checks. The separate classification by deepseek-v4p1-flash agrees this is a bug fix now that the additional resume-wake change is gone. The Opus 5.5 High source review ended without a report; its subsequent availability check succeeded, but no second source review completed. No commits were pushed, and The captures below show masked input only. They establish the two input transitions on a virtual display, not physical suspend or monitor timing. Ordinary wake, base: Ordinary wake, head: the same key leaves the field empty. Outside wake, base: Outside wake, head: |
When the lock has turned the displays off, the key that wakes the panel also landed in the password field, so the first unlock attempt after a blank failed on a stray character. The lock now records when it blanked the displays, and the view consumes a key pressed while they are off, after asking for the wake. The state is cleared by the lock's own wake and by the resume relight. While the displays are off the lock also asks Hyprland for their real state, so a panel relit behind its back, by a hotplug or a bound key, stops eating the first key; an answer that lands after the poll has stopped is dropped.
Hyprland lights the panel for any key or pointer motion and says nothing when it does, so a bound key like Volume Up or a nudge of the pointer left the panel lit while the lock still took the next typed key for the wake key. An idle monitor that runs only while the lock has the displays off now notices that input, and once it has settled for 150 ms without reaching the lock view the blank state is cleared. A key typed at the lock reaches the view first and is handled there as before. A display that arrives while locked comes up lit, so it clears the state too. The fixture now types real key events into the lock view tied to the real service, and its call moves into lock-autorepeat-test.sh.
26a1991 to
b9d7c2d
Compare
|
Revised in the commit just pushed, after the 25 November run. What changed. Hyprland lights the panel for any key or pointer motion, so the outside wakes a user can cause are input. While the lock has the displays off, an idle monitor now watches for input. A key typed at the lock reaches the view at once and is the wake key, as before. Any other input, such as a bound key like Volume Up or the pointer, clears the blank state once it has settled for 150 ms, so the keys typed after it all reach the field. A display that arrives while locked comes up lit, so it clears the state too. A blank started while a settle is pending cancels the settle. What is left. A DPMS change made without input, such as Tests. The fixture now types real key events through QtTest into the real |
|
At On a disposable Omarchy worker running this branch under Hyprland 0.57.2, I used a persistent Linux uinput device to check the real compositor input path:
The existing wake-key fixture now checks pre-blank idle monitoring, non-waking activity and delayed blanking. These checks fail without the corresponding changes. The CLI suite and seven focused lock suites passed on the candidate; the final timer guard also passed the focused key-input fixture. The original wake-key bug was reproduced on base The scripted DPMS-on case in your reply remains: typing GPT-6 High in Codex performed the source and worker checks. Opus 5.5 High contributed the two reproduced input mechanisms; muse-wonder via pi, thinking high also reviewed this head. The follow-up Opus review returned a further timing finding, but its runner exited 143 without a completed review record. A subsequent availability check succeeded, so this was an incomplete review, not an unavailable reviewer. No These captures compare the current branch with the unpublished candidate. They show masked input on a virtual display, not physical monitor or suspend timing. |








Summary
The key pressed to wake a dark lock screen went straight into the password field, so the first unlock attempt failed on a stray character.
The lock now records that it turned the displays off (
displaysBlank, set byrunBlank(), cleared byrunWake()and by the resume relight) and hands that to the view. A key pressed while the panel is dark asks for the wake and is consumed, the way hyprlock behaves. The view reads the flag before it asks for the wake, since the wake clears it.While the displays are off the lock also polls
hyprctl monitors -jevery 3 s and clears the flag once a display reports DPMS on, so a panel relit behind the lock's back, by a hotplug or a bound key, does not eat the first key. An answer that lands after the poll has stopped is dropped.This PR used to carry a second change, waking the panel on its own after resume.
quattrodoes that itself since eb7cfd0, so that commit is gone and the PR is the fix alone.Verification
test/shell.d/lock-wake-key-test.shloads the realLockView.qmlandService.qmlunder Quickshell with the display commands stubbed, and checks the view's decision and every way the service sets and clears the state. With the resume relight's clear removed, it fails.lock-*tests pass.