all repos — tint2 @ c2d6faabc72cd03d3a2664c88c0d65a32d848e2e

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Enable clock timer only when clock is used
o9000 mrovi9000@gmail.com
commit

c2d6faabc72cd03d3a2664c88c0d65a32d848e2e

parent

d7f294d7c266a4f9081133d42dbaecf8f8800a3d

1 files changed, 7 insertions(+), 6 deletions(-)

jump to
M src/clock/clock.csrc/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);