Skip to content

Pulse the fingerprint glyph and flag a rejected scan - #12291

Open
gj2908 wants to merge 3 commits into
omacom:quattrofrom
gj2908:fingerprint-feedback
Open

gj2908 wants to merge 3 commits into
omacom:quattrofrom
gj2908:fingerprint-feedback

Conversation

@gj2908

@gj2908 gj2908 commented Sep 17, 2026 •

Copy link
Copy Markdown

What

On the lock screen, a rejected fingerprint read re-arms the reader about a quarter second later, so a failed scan looked exactly like one that was still listening. Service.qml already tracked fingerprintAuthenticating, but never passed it into LockView.

This passes that flag plus a failure nonce into LockView and:

  • pulses the sensor glyph while PAM waits on the reader
  • on a rejection, turns the glyph urgent, nudges it, and shows "Try again" briefly
  • gives the polkit prompt the same pulse while it waits on the reader

Retry backoff

While testing this against a reader that sometimes wedges, I hit a worse failure than a missed animation. When pam_fprintd fails before it ever asks for a finger — a stale device, no enrolled prints, a busy reader — PAM returns in well under the retry interval. The old fixed 250ms retry then re-ran the failure immediately, and because every failure re-armed the retry, one flaky moment turned into a tight loop: thousands of PAM sessions a minute, each claiming the fingerprint device, which kept the reader wedged and left "Try again" strobing on the lock screen.

The service now records whether the reader ever engaged (onPamMessage), and the retry changes shape accordingly:

  • reader engaged (a real scan was rejected or timed out): re-arm immediately, flag the miss
  • reader never engaged (the stack failed before the scan): double the delay from 1s up to a 30s cap, and stay quiet

A backoff also can't be mistaken for a dead prompt, because a rejected scan still re-arms at once.

Tests

  • test/shell.d/lock-fingerprint-feedback-test.sh: the service raises the failure signal, the view receives the live state, and both failure paths retry through the shared helper
  • test/shell.d/lock-fingerprint-retry-test.sh (new): loads the service and asserts an unengaged failure backs off without flagging a miss, while an engaged failure re-arms and flags it
  • test/shell.d/lock-fingerprint-indicator-test.sh: the retry label appears on a rejection
  • test/shell.d/polkit-fingerprint-animation-test.sh (new): the polkit glyph pulses only while the prompt is live

Verification

The polkit pulse was verified in the running shell: capturing the prompt while it waited on the reader showed the center glyph brightness oscillating on the animation's period, and flat when the prompt was gone. The retry behaviour is covered by the headless test above. I could not capture the lock screen itself on this machine, but it uses the same animation mechanism as the polkit prompt.

The retry storm itself was measured on the affected machine: 4518 fingerprint PAM sessions in 20 minutes before the change, 1 in the 25 minutes after.

Notes

This overlaps #10393, which also reworks the retry loop in Service.qml. Whichever lands second needs a rebase, but the two are complementary: that PR changes how often the reader retries, this one makes each outcome visible and stops the retry from spinning when the reader is not there.

The second commit touches default/hypr/looknfeel.lua (window open/close motion). It is unrelated to the fingerprint work, so I'm happy to drop it or split it into its own PR.

The reader re-arms a quarter second after a rejection, so a failed scan looked the same as one still listening. Pass fingerprintAuthenticating and a failure nonce into LockView: the glyph pulses while PAM waits, then turns urgent, nudges, and shows "Try again" on a rejection. The polkit prompt gets the same pulse while it waits on the reader.
Add an easeOutExpo curve, open windows with a slightly stronger pop, close them on the same curve instead of linear, and enable the fade switch.
@developercrocodiles

Copy link
Copy Markdown

I am not a mentainer, but I think you should make a separate PR for the looknfeel.lua change. Also, this seams a personal change. Good work on the fingerprint reader bug fix. Looks good, hope it gets merged.

@jandrusk

Copy link
Copy Markdown

Rejected-scan feedback on the lock glyph is a real gap (today a fail looks like still-listening).

CONFLICTING vs quattro, and #13918 is also adding fingerprint reader state to lock/polkit — please rebase and either fold into that or keep the animation-only bits clearly separated from the looknfeel.lua personal bits called out in review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants