From 491a56db10d3591510f31dc297e6849cd203dc01 Mon Sep 17 00:00:00 2001 From: o9000 Date: Sun, 2 Jul 2017 23:19:24 +0200 Subject: [PATCH] Clock: Update correctly after suspend --- src/clock/clock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/clock/clock.c b/src/clock/clock.c index cb82754..5c5bc70 100644 --- a/src/clock/clock.c +++ b/src/clock/clock.c @@ -153,10 +153,11 @@ void update_clocks_min(void *arg) { // remember old_sec because after suspend/hibernate the clock should be updated directly, and not // on next minute change + static time_t old_sec = 0; gettimeofday(&time_clock, 0); - time_t old_sec = time_clock.tv_sec; if (time_clock.tv_sec % 60 == 0 || time_clock.tv_sec - old_sec > 60) update_clocks(); + old_sec = time_clock.tv_sec; } gboolean time_format_needs_sec_ticks(char *time_format)