diff options
| author | prezmop <60825986+prezmop@users.noreply.github.com> | 2023-12-09 09:30:42 +0100 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2023-12-10 13:02:22 +0100 |
| commit | f2298bdbf788678a9e08fd17a3e37600767f5a9b (patch) | |
| tree | 2e8a9bd1a22286738f1e30680b32ed5e5efc1dbd /password.c | |
| parent | 7cecd395a2ad64b25f40638be25d0e5f8080cd18 (diff) | |
Clear password on ctrl+backpace and ctrl+delete
Diffstat (limited to 'password.c')
| -rw-r--r-- | password.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -141,13 +141,19 @@ void swaylock_handle_key(struct swaylock_state *state, break; case XKB_KEY_Delete: case XKB_KEY_BackSpace: - if (backspace(&state->password)) { - state->input_state = INPUT_STATE_BACKSPACE; - schedule_password_clear(state); - update_highlight(state); - } else { + if (state->xkb.control) { + clear_password_buffer(&state->password); state->input_state = INPUT_STATE_CLEAR; cancel_password_clear(state); + } else { + if (backspace(&state->password)) { + state->input_state = INPUT_STATE_BACKSPACE; + schedule_password_clear(state); + update_highlight(state); + } else { + state->input_state = INPUT_STATE_CLEAR; + cancel_password_clear(state); + } } schedule_input_idle(state); damage_state(state); |
