summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
authoriyzana <16743652+iyzana@users.noreply.github.com>2023-06-29 11:21:10 +0200
committerSimon Ser <contact@emersion.fr>2024-08-22 09:02:10 +0200
commitc2dcd40c341bc7a8ce00030cea2feb2f4c5c3026 (patch)
tree25f85add2938e1eeceda38a49f641a64b6606328 /password.c
parentb70d85ec145520ba3ebaa4c51921a2761bc0c7f0 (diff)
Show cleared state when backspacing last character
Diffstat (limited to 'password.c')
-rw-r--r--password.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/password.c b/password.c
index cae568e..5349e13 100644
--- a/password.c
+++ b/password.c
@@ -146,7 +146,7 @@ void swaylock_handle_key(struct swaylock_state *state,
state->input_state = INPUT_STATE_CLEAR;
cancel_password_clear(state);
} else {
- if (backspace(&state->password)) {
+ if (backspace(&state->password) && state->password.len != 0) {
state->input_state = INPUT_STATE_BACKSPACE;
schedule_password_clear(state);
update_highlight(state);