mirror of
https://github.com/hyprwm/hyprlock.git
synced 2024-12-22 13:29:48 +01:00
input-field: show autentication failReason without additional input (#98)
This makes it so that 1. The renderer is triggered when the onPasswordCheckTimer callback is fired. Previously you had to give an additional input for the renderer to be triggered and the fail reason to show. 2. The updateDots function now sets dots.currentAmout to 0, when a failID is present. That leads to the draw function to return false and the failReason to be displayed until another input happens.
This commit is contained in:
parent
4aeea1d580
commit
ac757cf7ab
2 changed files with 9 additions and 0 deletions
|
@ -638,6 +638,10 @@ void CHyprlock::onPasswordCheckTimer() {
|
||||||
Debug::log(LOG, "Authentication failed: {}", m_sPasswordState.result->failReason);
|
Debug::log(LOG, "Authentication failed: {}", m_sPasswordState.result->failReason);
|
||||||
m_sPasswordState.lastFailReason = m_sPasswordState.result->failReason;
|
m_sPasswordState.lastFailReason = m_sPasswordState.result->failReason;
|
||||||
m_sPasswordState.passBuffer = "";
|
m_sPasswordState.passBuffer = "";
|
||||||
|
|
||||||
|
for (auto& o : m_vOutputs) {
|
||||||
|
o->sessionLockSurface->render();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_sPasswordState.result.reset();
|
m_sPasswordState.result.reset();
|
||||||
|
|
|
@ -77,6 +77,11 @@ void CPasswordInputField::updateDots() {
|
||||||
dots.lastFrame = std::chrono::system_clock::now();
|
dots.lastFrame = std::chrono::system_clock::now();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (PASSLEN == 0 && !placeholder.failID.empty()) {
|
||||||
|
dots.currentAmount = PASSLEN;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto DELTA = std::clamp((int)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - dots.lastFrame).count(), 0, 20000);
|
const auto DELTA = std::clamp((int)std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - dots.lastFrame).count(), 0, 20000);
|
||||||
|
|
||||||
const float TOADD = DELTA / 1000000.0 * dots.speedPerSecond;
|
const float TOADD = DELTA / 1000000.0 * dots.speedPerSecond;
|
||||||
|
|
Loading…
Reference in a new issue