mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-02-03 16:29:48 +01:00
fingerprint: add a delay after an unrecognized fingerprint (#625)
This commit is contained in:
parent
a2f00fb735
commit
e01afaf107
2 changed files with 8 additions and 1 deletions
|
@ -169,7 +169,13 @@ void CFingerprint::handleVerifyStatus(const std::string& result, bool done) {
|
|||
m_sFailureReason = "Fingerprint auth disabled (too many failed attempts)";
|
||||
} else {
|
||||
done = false;
|
||||
startVerify(true);
|
||||
static const auto RETRYDELAY = **(Hyprlang::INT* const*)(g_pConfigManager->getValuePtr("auth:fingerprint:retry_delay"));
|
||||
g_pHyprlock->addTimer(
|
||||
std::chrono::milliseconds(RETRYDELAY),
|
||||
[](std::shared_ptr<CTimer> self, void* data) {
|
||||
((CFingerprint*)data)->startVerify(true);
|
||||
},
|
||||
this);
|
||||
}
|
||||
break;
|
||||
case MATCH_UNKNOWN_ERROR:
|
||||
|
|
|
@ -194,6 +194,7 @@ void CConfigManager::init() {
|
|||
m_config.addConfigValue("auth:fingerprint:enabled", Hyprlang::INT{0});
|
||||
m_config.addConfigValue("auth:fingerprint:ready_message", Hyprlang::STRING{"(Scan fingerprint to unlock)"});
|
||||
m_config.addConfigValue("auth:fingerprint:present_message", Hyprlang::STRING{"Scanning fingerprint"});
|
||||
m_config.addConfigValue("auth:fingerprint:retry_delay", Hyprlang::INT{250});
|
||||
|
||||
m_config.addSpecialCategory("background", Hyprlang::SSpecialCategoryOptions{.key = nullptr, .anonymousKeyBased = true});
|
||||
m_config.addSpecialConfigValue("background", "monitor", Hyprlang::STRING{""});
|
||||
|
|
Loading…
Reference in a new issue