Fix fingerprint sensor timeout on long-running lock sessions#955
Fix fingerprint sensor timeout on long-running lock sessions#955JeremieRodon wants to merge 1 commit intohyprwm:mainfrom
Conversation
Jackaed
left a comment
There was a problem hiding this comment.
These changes do fix the issue on my system!
I don't know if Hyprland follows the general conventions on commit messages, but you may want to change the commit message to a short title and an explanatory body. See https://www.conventionalcommits.org/en/v1.0.0/.
Introduces an inactivity timeout mechanism that pauses fingerprint verification after a configurable period (default: 30 seconds) when no user input is detected. This prevents device drivers from disconnecting or disabling the sensor during extended lock sessions. The verification automatically resumes when user activity is detected (mouse movement, clicks, or keyboard input). The sensor is properly released when paused and re-claimed when resuming. Fixes hyprwm#702
edebfeb to
cf560a6
Compare
|
Update: This doesn't fix the issues I was experiencing (which is the issue described in #702 (comment)). This doesn't mean that this shouldn't be merged, but I don't think it fixes #702. |
|
I have the exact same issue, using a custom build of libfprint to support my USB based Chipsailing GS9711Fingprint device. |
Sorry to hear that 🙁 I'll admit it is difficult to assert exactly what is the issue in #702 as the original report, your comment and mine could well be 3 separate problems. The original report logs are not really helpful. If we want to understand what happens, we ought to correlate both
Do you mean you have the same issue as me, same issue as @Jackaed or just that my PR does not fix your problem whatever it is? |
|
While the idea is ok, I don't believe you actually thought about what this code does. |
I am using fingerprint and this code change is what's been enabling me to use it daily with Hyprlock for 3 weeks now. I did thought about what this do and I argued my choice in the PR description.
I will also admit that my time writing C was 15 years ago and I never wrote more than a few lines of C++ so I chose the easiest path I could to fix the issue. I believe I made it clear that I was actively asking for suggestions on how to better detect the "AFK-ness" of the user.
You are the second person pointing that comments are not helpful. I will abide and remove them, that's your project. Just know that as an external contributor not familiar with the project nor C++, these kind of unhelpful comments would have saved me at least an hour that instead was dedicated to understand what does what. But I get that they may be redundant for you.
I did use Claude to generate the original text, then I modified it to remove false claims. I did not care about the writing style though, sorry for that I suppose.
Ok.
You may discuss that with the people responsible for the behavior/design of There is only two fixes I can imagine for that in Hyprlock:
|
Summary
This PR addresses issue #702 where fingerprint authentication stops working after the session is left locked for approximately 3-5 minutes (for me).
The root cause I identified is that keeping the fingerprint sensor in an active verification state indefinitely causes some device drivers to disconnect or disable the sensor, leading to a no-retry error in Hyprlock's fingerprint handler.
Changes
The solution introduces an inactivity timeout mechanism that automatically pauses fingerprint verification when no user input is detected, then resumes scanning when the user interacts with the lock screen:
New configuration parameter:
auth:fingerprint:inactive_timeout<= 0, the timeout is disabled (preserving previous behavior)Activity tracking: The fingerprint handler now monitors user input events:
Verification management:
Implementation Details
Modified files:
src/auth/Fingerprint.cpp/.hpp: Core timeout logic and activity handlingsrc/config/ConfigManager.cpp: New configuration parametersrc/core/Seat.cpp: Mouse movement event trackingsrc/core/hyprlock.cpp/.hpp: NewonMouseMovehandler. Activity event propagation to fingerprint handlerKey technical choices:
Configuration
Users can add this to their
hyprlock.conf:Discussion Points
I chose a 30-second default as a balance between:
It also means that the timeout is enabled by default. My rational is that I believe:
Thoughts?
When the Fingerprint verification is paused, I decided to remove the
$FPRINTPROMPTcontent to provide a kind of visual feedback to the user. This is based on the observation that$FPRINTPROMPTis initially empty when hyprlock start rendering.Thoughts?
I added the new
onMouseMove()event handler onCHyprlockmostly because I did not have any better idea. I'm really not knowledgeable in Hyprland ecosystem in general and there may be a better solution to detect that the user is AFK. I'm really all ears on the topic and will be happy to implement it another way if pointed in the right direction.Thoughts?
Testing
Tested on my system, where I experience the fingerprint disconnection issue (Goodix Fingerprint Sensor 53xc). The timeout mechanism successfully prevents sensor driver disconnections while maintaining a responsive unlock experience.
Fixes #702