Enable clock timer only when clock is used
o9000 mrovi9000@gmail.com
1 files changed,
7 insertions(+),
6 deletions(-)
jump to
M
src/clock/clock.c
→
src/clock/clock.c
@@ -163,6 +163,13 @@ }
void init_clock() { +} + +void init_clock_panel(void *p) +{ + Panel *panel = (Panel *)p; + Clock *clock = &panel->clock; + if (!clock_timeout) { if (time_format_needs_sec_ticks(time1_format) || time_format_needs_sec_ticks(time2_format)) { clock_timeout = add_timeout(10, 1000, update_clocks_sec, 0, &clock_timeout);@@ -170,12 +177,6 @@ } else {
clock_timeout = add_timeout(10, 1000, update_clocks_min, 0, &clock_timeout); } } -} - -void init_clock_panel(void *p) -{ - Panel *panel = (Panel *)p; - Clock *clock = &panel->clock; if (!clock->area.bg) clock->area.bg = &g_array_index(backgrounds, Background, 0);