diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c index 19379626..e06613ff 100644 --- a/clients/desktop-shell.c +++ b/clients/desktop-shell.c @@ -425,12 +425,16 @@ panel_launcher_tablet_tool_button_handler(struct widget *widget, panel_launcher_activate(launcher); } +static int clock_timer_reset(struct panel_clock *clock); + static void clock_func(struct toytimer *tt) { struct panel_clock *clock = container_of(tt, struct panel_clock, timer); widget_schedule_redraw(clock->widget); + + clock_timer_reset(clock); } static void @@ -481,7 +485,7 @@ clock_timer_reset(struct panel_clock *clock) clock_gettime(CLOCK_REALTIME, &ts); tm = localtime(&ts.tv_sec); - its.it_interval.tv_sec = clock->refresh_timer; + its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; its.it_value.tv_sec = clock->refresh_timer - tm->tm_sec % clock->refresh_timer; its.it_value.tv_nsec = 10000000; /* 10 ms late to ensure the clock digit has actually changed */