From 585f8250288b78829d2ac764b6e5c4eb32b4e23d Mon Sep 17 00:00:00 2001 From: Thierry Lorthiois Date: Sat, 18 Sep 2010 18:19:43 +0000 Subject: [PATCH] panel_items : allow panel without taskbar --- src/config.c | 3 ++- src/taskbar/taskbar.c | 5 ++++- src/taskbar/taskbar.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.c b/src/config.c index de8a90d..a464203 100644 --- a/src/config.c +++ b/src/config.c @@ -242,7 +242,8 @@ void add_entry (char *key, char *value) for (j=0 ; j < strlen(panel_items_order) ; j++) { if (panel_items_order[j] == 'L') launcher_enabled = 1; - //if (panel_items_order[j] == 'T') + if (panel_items_order[j] == 'T') + taskbar_enabled = 1; if (panel_items_order[j] == 'B') { #ifdef ENABLE_BATTERY battery_enabled = 1; diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 2b505df..aa65991 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -41,6 +41,7 @@ GHashTable* win_to_task_table; Task *task_active; Task *task_drag; +int taskbar_enabled; guint win_hash(gconstpointer key) { return (guint)*((Window*)key); } gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); } @@ -52,6 +53,7 @@ void default_taskbar() win_to_task_table = 0; urgent_timeout = 0; urgent_list = 0; + taskbar_enabled = 0; } void cleanup_taskbar() @@ -220,7 +222,7 @@ Task *task_get_task (Window win) GPtrArray* task_get_tasks(Window win) { - if (win_to_task_table) + if (win_to_task_table && taskbar_enabled) return g_hash_table_lookup(win_to_task_table, &win); else return 0; @@ -232,6 +234,7 @@ void task_refresh_tasklist () Window *win; int num_results, i; + if (!taskbar_enabled) return; win = server_get_property (server.root_win, server.atom._NET_CLIENT_LIST, XA_WINDOW, &num_results); if (!win) return; diff --git a/src/taskbar/taskbar.h b/src/taskbar/taskbar.h index 6622858..f863684 100644 --- a/src/taskbar/taskbar.h +++ b/src/taskbar/taskbar.h @@ -13,6 +13,7 @@ extern GHashTable* win_to_task_table; extern Task *task_active; extern Task *task_drag; +extern int taskbar_enabled; // tint2 use one taskbar per desktop. typedef struct { -- 2.45.2