core: do not process keys on pending password verif

fixes #54
This commit is contained in:
Vaxry 2024-02-21 23:05:36 +00:00
parent 29c5d4da94
commit af9e8d1758

View file

@ -644,6 +644,13 @@ std::optional<std::string> CHyprlock::passwordLastFailReason() {
void CHyprlock::onKey(uint32_t key) {
const auto SYM = xkb_state_key_get_one_sym(m_pXKBState, key + 8);
if (m_sPasswordState.result) {
for (auto& o : m_vOutputs) {
o->sessionLockSurface->render();
}
return;
}
if (SYM == XKB_KEY_BackSpace) {
if (m_sPasswordState.passBuffer.length() > 0)
m_sPasswordState.passBuffer = m_sPasswordState.passBuffer.substr(0, m_sPasswordState.passBuffer.length() - 1);