-
- ev_timer_stop(main_loop, clear_indicator_timeout);
- free(clear_indicator_timeout);
- clear_indicator_timeout = NULL;
-}
-
-/*
- * (Re-)starts the clear_indicator timeout. Called after pressing backspace or
- * after an unsuccessful authentication attempt.
- *
- */
-void start_clear_indicator_timeout() {
- if (clear_indicator_timeout) {
- ev_timer_stop(main_loop, clear_indicator_timeout);
- ev_timer_set(clear_indicator_timeout, 1.0, 0.);
- ev_timer_start(main_loop, clear_indicator_timeout);
- } else {
- /* When there is no memory, we just don’t have a timeout. We cannot
- * exit() here, since that would effectively unlock the screen. */
- if (!(clear_indicator_timeout = calloc(sizeof(struct ev_timer), 1)))
- return;
- ev_timer_init(clear_indicator_timeout, clear_indicator, 1.0, 0.);
- ev_timer_start(main_loop, clear_indicator_timeout);
- }
-}
-
-/*
- * Stops the clear_indicator timeout.
- *
- */
-void stop_clear_indicator_timeout() {
- if (clear_indicator_timeout) {
- ev_timer_stop(main_loop, clear_indicator_timeout);
- free(clear_indicator_timeout);
- clear_indicator_timeout = NULL;
- }