Change the unlock indicator properly after pressing the 'escape' key
This commit is contained in:
parent
0a09aeec6f
commit
cab5e6b1de
12
i3lock.c
12
i3lock.c
|
@ -253,6 +253,13 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
||||||
input_position = 0;
|
input_position = 0;
|
||||||
clear_password_memory();
|
clear_password_memory();
|
||||||
password[input_position] = '\0';
|
password[input_position] = '\0';
|
||||||
|
|
||||||
|
/* Hide the unlock indicator after a bit if the password buffer is
|
||||||
|
* empty. */
|
||||||
|
start_clear_indicator_timeout();
|
||||||
|
unlock_state = STATE_BACKSPACE_ACTIVE;
|
||||||
|
redraw_screen();
|
||||||
|
unlock_state = STATE_KEY_PRESSED;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case XK_BackSpace:
|
case XK_BackSpace:
|
||||||
|
@ -263,13 +270,12 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
||||||
u8_dec(password, &input_position);
|
u8_dec(password, &input_position);
|
||||||
password[input_position] = '\0';
|
password[input_position] = '\0';
|
||||||
|
|
||||||
/* Clear this state after 2 seconds (unless the user enters another
|
/* Hide the unlock indicator after a bit if the password buffer is
|
||||||
* password during that time). */
|
* empty. */
|
||||||
start_clear_indicator_timeout();
|
start_clear_indicator_timeout();
|
||||||
unlock_state = STATE_BACKSPACE_ACTIVE;
|
unlock_state = STATE_BACKSPACE_ACTIVE;
|
||||||
redraw_screen();
|
redraw_screen();
|
||||||
unlock_state = STATE_KEY_PRESSED;
|
unlock_state = STATE_KEY_PRESSED;
|
||||||
//printf("new input position = %d, new password = %s\n", input_position, password);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue