mirror of https://github.com/i3/i3lock.git
Merge pull request #13 from Airblader/feature-12
Only redraw the screen if the unlock indicator is actually used.pull/14/head
commit
8a49effade
6
i3lock.c
6
i3lock.c
|
@ -240,10 +240,12 @@ static void clear_input(void) {
|
||||||
|
|
||||||
/* Hide the unlock indicator after a bit if the password buffer is
|
/* Hide the unlock indicator after a bit if the password buffer is
|
||||||
* empty. */
|
* empty. */
|
||||||
|
if (unlock_indicator) {
|
||||||
START_TIMER(clear_indicator_timeout, 1.0, clear_indicator_cb);
|
START_TIMER(clear_indicator_timeout, 1.0, clear_indicator_cb);
|
||||||
unlock_state = STATE_BACKSPACE_ACTIVE;
|
unlock_state = STATE_BACKSPACE_ACTIVE;
|
||||||
redraw_screen();
|
redraw_screen();
|
||||||
unlock_state = STATE_KEY_PRESSED;
|
unlock_state = STATE_KEY_PRESSED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void turn_off_monitors_cb(EV_P_ ev_timer *w, int revents) {
|
static void turn_off_monitors_cb(EV_P_ ev_timer *w, int revents) {
|
||||||
|
@ -322,6 +324,7 @@ static void input_done(void) {
|
||||||
pam_state = STATE_PAM_WRONG;
|
pam_state = STATE_PAM_WRONG;
|
||||||
failed_attempts += 1;
|
failed_attempts += 1;
|
||||||
clear_input();
|
clear_input();
|
||||||
|
if (unlock_indicator)
|
||||||
redraw_screen();
|
redraw_screen();
|
||||||
|
|
||||||
/* Clear this state after 2 seconds (unless the user enters another
|
/* Clear this state after 2 seconds (unless the user enters another
|
||||||
|
@ -470,6 +473,7 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
||||||
input_position += n - 1;
|
input_position += n - 1;
|
||||||
DEBUG("current password = %.*s\n", input_position, password);
|
DEBUG("current password = %.*s\n", input_position, password);
|
||||||
|
|
||||||
|
if (unlock_indicator) {
|
||||||
unlock_state = STATE_KEY_ACTIVE;
|
unlock_state = STATE_KEY_ACTIVE;
|
||||||
redraw_screen();
|
redraw_screen();
|
||||||
unlock_state = STATE_KEY_PRESSED;
|
unlock_state = STATE_KEY_PRESSED;
|
||||||
|
@ -477,6 +481,8 @@ static void handle_key_press(xcb_key_press_event_t *event) {
|
||||||
struct ev_timer *timeout = NULL;
|
struct ev_timer *timeout = NULL;
|
||||||
START_TIMER(timeout, TSTAMP_N_SECS(0.25), redraw_timeout);
|
START_TIMER(timeout, TSTAMP_N_SECS(0.25), redraw_timeout);
|
||||||
STOP_TIMER(clear_indicator_timeout);
|
STOP_TIMER(clear_indicator_timeout);
|
||||||
|
}
|
||||||
|
|
||||||
START_TIMER(discard_passwd_timeout, TSTAMP_N_MINS(3), discard_passwd_cb);
|
START_TIMER(discard_passwd_timeout, TSTAMP_N_MINS(3), discard_passwd_cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue