Skip to content

auth: release fingerprint device before sleep so verification restarts on wake - #1098

Open
Tecknich wants to merge 2 commits into
hyprwm:mainfrom
Tecknich:fingerprint-release-on-sleep
Open

Tecknich wants to merge 2 commits into
hyprwm:mainfrom
Tecknich:fingerprint-release-on-sleep

Conversation

@Tecknich

Copy link
Copy Markdown

Problem

If fprintd goes away while a verification is running and the system then suspends, fingerprint auth never comes back after wake. It stays dead for the rest of that lock session, and only a password unlock recovers it.

The PrepareForSleep(false) handler only calls startVerify() when verifying is false. verifying is cleared only by stopVerify(), which runs in response to a VerifyStatus signal. When fprintd exits during a verify (stopped before suspend, restarted, or killed with the sensor), no VerifyStatus is sent. verifying stays true, the wake handler does nothing, and hyprlock keeps a device proxy whose claim belongs to a dead fprintd instance. On unlock, terminate() then fails with:

Authorization denied to :1.xxx to call method 'Release' for device 'Synaptics Sensors': Device was not claimed before use

I hit this on a ThinkPad X1 Extreme Gen 5 (Synaptics 06cb:00f9, the sensor from #577). It loses power in S3, so fprintd is stopped before suspend; otherwise the open claim wedges the daemon across resume. A lock started at suspend time works, because no verify is running yet. A suspend that interrupts a running verify (lock, brief wake, suspend again) hits the bug every time.

Fix

On PrepareForSleep(true), stop the verify and release the device right away. That clears verifying and resets the proxy, so the wake path always goes through createDeviceProxy() → Claim → VerifyStart against whatever fprintd instance is alive after resume. Both calls already handle D-Bus errors, so this is harmless if fprintd has already gone.

Testing

  • Patched 0.9.6 on Arch, fprintd 1.94.5 / libfprint 1.94.100: lock, wake, wait for the fingerprint prompt, suspend again, wake, touch → unlocks. Before the change the reader stayed dead every time.
  • Lock-at-suspend still works as before.
  • main with this change builds cleanly; clang-format --dry-run -Werror passes.

🤖 Generated with Claude Code

Tecknich and others added 2 commits November 12, 2026 16:41
…s on wake

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ing style

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant