From eb0e6765f98a788c8a7efc63d01da316b3c1c5be Mon Sep 17 00:00:00 2001 From: o9000 Date: Fri, 29 Dec 2017 14:38:06 +0100 Subject: [PATCH] Taskbar: setup timers in init_() to allow restart --- src/init.c | 1 + src/panel.c | 2 -- src/taskbar/taskbar.c | 9 +++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/init.c b/src/init.c index 2252fa9..82010c6 100644 --- a/src/init.c +++ b/src/init.c @@ -267,6 +267,7 @@ void cleanup() cleanup_battery(); #endif cleanup_separator(); + cleanup_taskbar(); cleanup_panel(); cleanup_config(); diff --git a/src/panel.c b/src/panel.c index f481f3f..6e02c94 100644 --- a/src/panel.c +++ b/src/panel.c @@ -130,8 +130,6 @@ void cleanup_panel() if (!panels) return; - cleanup_taskbar(); - for (int i = 0; i < num_panels; i++) { Panel *p = &panels[i]; diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 6234883..a4df3b9 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -80,7 +80,6 @@ void free_ptr_array(gpointer data) void default_taskbar() { win_to_task = NULL; - INIT_TIMER(urgent_timer); urgent_list = NULL; taskbar_enabled = FALSE; taskbar_distribute_size = FALSE; @@ -89,9 +88,6 @@ void default_taskbar() hide_task_diff_monitor = FALSE; hide_taskbar_if_empty = FALSE; always_show_all_desktop_tasks = FALSE; - INIT_TIMER(thumbnail_update_timer_all); - INIT_TIMER(thumbnail_update_timer_active); - INIT_TIMER(thumbnail_update_timer_tooltip); taskbar_thumbnail_jobs_done = NULL; taskbar_sort_method = TASKBAR_NOSORT; taskbar_alignment = ALIGN_LEFT; @@ -184,6 +180,11 @@ void cleanup_taskbar() void init_taskbar() { + INIT_TIMER(urgent_timer); + INIT_TIMER(thumbnail_update_timer_all); + INIT_TIMER(thumbnail_update_timer_active); + INIT_TIMER(thumbnail_update_timer_tooltip); + if (!panel_config.g_task.has_text && !panel_config.g_task.has_icon) { panel_config.g_task.has_text = panel_config.g_task.has_icon = 1; }