From c32081a8c7ff4dd0c099a7fede4835b4f2a9acdc Mon Sep 17 00:00:00 2001 From: Siavash Askari Nasr Date: Wed, 21 Feb 2024 10:44:30 +0330 Subject: [PATCH] Clear password buffer with escape key --- src/core/hyprlock.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 1de64e14..09c7d20a 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -454,6 +454,10 @@ void CHyprlock::onKey(uint32_t key) { Debug::log(LOG, "Authenticating"); m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer); + } else if (SYM == XKB_KEY_Escape) { + Debug::log(LOG, "Clearing password buffer"); + + m_sPasswordState.passBuffer = ""; } else { char buf[16] = {0}; int len = xkb_keysym_to_utf8(SYM, buf, 16);