]> Dogcows Code - chaz/tint2/commitdiff
panel_items : allow panel without taskbar
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sat, 18 Sep 2010 18:19:43 +0000 (18:19 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sat, 18 Sep 2010 18:19:43 +0000 (18:19 +0000)
src/config.c
src/taskbar/taskbar.c
src/taskbar/taskbar.h

index de8a90d34e70406d80eed0daa4d038c952349dd6..a4642031c9d06f22d2074469867d11130a1071da 100644 (file)
@@ -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;
index 2b505dfeab06a32837eebf3fb4145b4020b01b1e..aa65991ad5fe4483b7a903c6eb498af4c304f12a 100644 (file)
@@ -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;
 
index 6622858378f6954ffad5474aefa3639ad2afbcea..f863684c12a002d7f0036efd0cc4d463f5a295f4 100644 (file)
@@ -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 {
This page took 0.026399 seconds and 4 git commands to generate.