X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Ftaskbar%2Ftaskbar.c;h=4bf6db5d095dd27ced81aa729b50033976b3e994;hb=b60f1947e2397dc695dafda288b2989b4415ce02;hp=34f49b0a52accebe6e2230d33376c04b930c4ea3;hpb=43df01880e106d710ea57a2025db17f7d7db74fa;p=chaz%2Ftint2 diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 34f49b0..4bf6db5 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -39,6 +39,9 @@ */ GHashTable* win_to_task_table; +Task *task_active; +Task *task_drag; + guint win_hash(gconstpointer key) { return (guint)*((Window*)key); } gboolean win_compare(gconstpointer a, gconstpointer b) { return (*((Window*)a) == *((Window*)b)); } void free_ptr_array(gpointer data) { g_ptr_array_free(data, 1); } @@ -51,6 +54,9 @@ void init_taskbar() if (win_to_task_table == 0) win_to_task_table = g_hash_table_new_full(win_hash, win_compare, free, free_ptr_array); + task_active = 0; + task_drag = 0; + for (i=0 ; i < nb_panel ; i++) { panel = &panel1[i]; @@ -142,7 +148,7 @@ void init_taskbar() panel->g_task.maximum_width = server.monitor[panel->monitor].width; panel->g_task.text_posx = panel->g_task.background[0]->border.width + panel->g_task.area.paddingxlr; - panel->g_task.text_posy = (panel->g_task.area.height - height) / 2.0; + panel->g_task.text_height = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); if (panel->g_task.icon) { panel->g_task.icon_size1 = panel->g_task.area.height - (2 * panel->g_task.area.paddingy); panel->g_task.text_posx += panel->g_task.icon_size1; @@ -218,7 +224,10 @@ Task *task_get_task (Window win) GPtrArray* task_get_tasks(Window win) { - return g_hash_table_lookup(win_to_task_table, &win); + if (win_to_task_table) + return g_hash_table_lookup(win_to_task_table, &win); + else + return 0; } @@ -230,10 +239,6 @@ void task_refresh_tasklist () win = server_get_property (server.root_win, server.atom._NET_CLIENT_LIST, XA_WINDOW, &num_results); if (!win) return; - // Remove any old and set active win - // remark from Andreas: This seems unneccessary... -// active_task(); - GList* win_list = g_hash_table_get_keys(win_to_task_table); GList* it; for (it=win_list; it; it=it->next) {