Flash the lock screen fingerprint icon when a read is rejected - #11162
Open
PapeThePope wants to merge 2 commits into
Open
PapeThePope wants to merge 2 commits into
PapeThePope wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The lock screen gives no feedback when a fingerprint read is rejected. The hint icon sits static while pam_fprintd relays
Failed to match fingerprintand the PAM conversation keeps running, so a rejected touch looks the same as a sensor that isn't reading at all.Fix
Give the fingerprint hint icon a brief rejection flash:
Service.qmlbumpsfingerprintFailureTickwhenever the fingerprintPamContextrelays a message withmessageIsError, and passes the counter to the view.LockView.qmlflips the icon toColor.lock.textErrorand dims it to0.2opacity for a second, then a timer returns it to the hint color.Only rejected reads flash: silent verify timeouts and PAM service errors relay no error message, so the icon is left alone.
The opacity dim matters because the flash must not rely on the theme's error color being distinct. A survey of the 22 stock themes (generating each
shell.tomlwithomarchy-theme-set-templates) found two where a color-only flash is invisible:tokyo-nightshipsthemes/tokyo-night/shell.lock.tomlwith every[lock]color — includingtext-errorandborder-active— set to the foreground (#a9b1d6), so error and idle states are identical. That also means failed-password error coloring never shows on tokyo-night.vantablackhastext-error = #a4a4a4againstplaceholder = #a8a8a8, which is imperceptible.The remaining 20 stock themes get distinct error colors from
default/themed/shell.toml.tpl. Dimming in addition to recoloring keeps the feedback visible regardless of the theme palette.Deliberately scoped to the visual feedback. The display blank/wake behavior during a fingerprint verify is separate work (see #10653), and the "reader unavailable" state belongs to #7158.
Tests
test/shell.d/lock-fingerprint-feedback-test.shcovers the service wiring: an error message bumps the tick, the tick reaches the view, the flash clears on its timer, and the icon binds to the error color and dims.test/shell.d/lock-fingerprint-indicator-test.shnow also asserts the icon enters its error state, uses the error color, and dims on a rejected read.apply-lock,lock-blank-fingerprint,lock-fingerprint-feedback,lock-fingerprint-indicator,lock-password-overflow,lock-stranded-recovery,sleep-lock,system-lock,update-lock,hyprland-session-locked.Verification on hardware
With a Broadcom sensor and fprintd, a rejected read flashes the icon in the error color and dims it, then it returns to the hint color a second later; a valid read still unlocks unchanged. Also verified live on the tokyo-night theme.