summaryrefslogtreecommitdiff
path: root/password.c
diff options
context:
space:
mode:
Diffstat (limited to 'password.c')
-rw-r--r--password.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/password.c b/password.c
index 8dabb52..cae568e 100644
--- a/password.c
+++ b/password.c
@@ -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);