summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2011-12-29 02:56:28 +0100
committerMichael Stapelberg <michael@stapelberg.de>2011-12-29 02:56:28 +0100
commit7fdda76a511c4679a2ffdb8e877bca9277772443 (patch)
tree2ab11f269a3ef113221ea6424591003e6269c3c9
parent1b757b2aa9c93dc3e802f015ef23daa11de6b081 (diff)
Fix the timeouts for hiding the unlock indicator (Thanks Merovius)
-rw-r--r--i3lock.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/i3lock.c b/i3lock.c
index 64a7869..27ef46d 100644
--- a/i3lock.c
+++ b/i3lock.c
@@ -279,6 +279,7 @@ static void redraw_screen() {
*
*/
static void clear_pam_wrong(EV_P_ ev_timer *w, int revents) {
+ DEBUG("clearing pam wrong\n");
pam_state = STATE_PAM_IDLE;
unlock_state = STATE_STARTED;
redraw_screen();
@@ -290,8 +291,10 @@ static void clear_pam_wrong(EV_P_ ev_timer *w, int revents) {
*
*/
static void clear_indicator(EV_P_ ev_timer *w, int revents) {
- DEBUG("Clear indicator\n");
- unlock_state = STATE_STARTED;
+ if (input_position == 0) {
+ DEBUG("Clear indicator\n");
+ unlock_state = STATE_STARTED;
+ } else unlock_state = STATE_KEY_PRESSED;
redraw_screen();
}
@@ -341,6 +344,13 @@ static void input_done() {
ev_timer_init(clear_pam_wrong_timeout, clear_pam_wrong, 2.0, 0.);
ev_timer_start(main_loop, clear_pam_wrong_timeout);
+ /* Cancel the clear_indicator_timeout, it would hide the unlock indicator
+ * too early. */
+ if (clear_indicator_timeout) {
+ ev_timer_stop(main_loop, clear_indicator_timeout);
+ clear_indicator_timeout = NULL;
+ }
+
/* beep on authentication failure, if enabled */
if (beep) {
xcb_bell(conn, 100);