Show cleared state when backspacing last character

This commit is contained in:
iyzana 2023-06-29 11:21:10 +02:00 committed by Simon Ser
parent b70d85ec14
commit c2dcd40c34

View File

@ -146,7 +146,7 @@ void swaylock_handle_key(struct swaylock_state *state,
state->input_state = INPUT_STATE_CLEAR; state->input_state = INPUT_STATE_CLEAR;
cancel_password_clear(state); cancel_password_clear(state);
} else { } else {
if (backspace(&state->password)) { if (backspace(&state->password) && state->password.len != 0) {
state->input_state = INPUT_STATE_BACKSPACE; state->input_state = INPUT_STATE_BACKSPACE;
schedule_password_clear(state); schedule_password_clear(state);
update_highlight(state); update_highlight(state);