all repos — tint2 @ b99b5c6b8af6450bee7d2606ef3f6d7b6dba3706

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

little cleanup

git-svn-id: http://tint2.googlecode.com/svn/trunk@440 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
thilor77 thilor77@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

b99b5c6b8af6450bee7d2606ef3f6d7b6dba3706

parent

885377a234c68e033bc049470cb17b468e2085e0

5 files changed, 16 insertions(+), 18 deletions(-)

jump to
M src/panel.csrc/panel.c

@@ -59,8 +59,6 @@ int panel_autohide_hide_timeout;

int panel_autohide_height; int panel_strut_policy; -Task *task_active; -Task *task_drag; int max_tick_urgent; // panel's initial config

@@ -83,8 +81,6 @@ {

panel1 = 0; nb_panel = 0; default_icon = NULL; - task_active = 0; - task_drag = 0; task_dragged = 0; panel_horizontal = 1; panel_position = CENTER;

@@ -125,7 +121,8 @@ if (p->main_win) XDestroyWindow(server.dsp, p->main_win);

} if (panel1) free(panel1); - if (backgrounds) g_array_free(backgrounds, 1); + if (backgrounds) + g_array_free(backgrounds, 1); if (panel_config.g_task.font_desc) pango_font_description_free(panel_config.g_task.font_desc); }
M src/panel.hsrc/panel.h

@@ -59,8 +59,6 @@ extern int panel_autohide_hide_timeout;

extern int panel_autohide_height; // for vertical panels this is of course the width extern int panel_strut_policy; -extern Task *task_active; -extern Task *task_drag; extern int max_tick_urgent; extern GArray* backgrounds;
M src/server.csrc/server.c

@@ -104,7 +104,8 @@ if (server.colormap32) XFreeColormap(server.dsp, server.colormap32);

if (server.monitor) { int i; for (i=0; i<server.nb_monitor; ++i) - g_strfreev(server.monitor[i].names); + if (server.monitor[i].names) + g_strfreev(server.monitor[i].names); free(server.monitor); } if (server.gc) XFreeGC(server.dsp, server.gc);

@@ -247,15 +248,6 @@

void get_monitors() { - if (server.monitor) { - int i; - for (i=0; i<server.nb_monitor; ++i) - g_strfreev(server.monitor[i].names); - free(server.monitor); - } - server.nb_monitor = 0; - server.monitor = 0; - int i, j, nbmonitor; if (XineramaIsActive(server.dsp)) { XineramaScreenInfo *info = XineramaQueryScreens(server.dsp, &nbmonitor);

@@ -309,7 +301,8 @@ i++;

} next: for (j=i; j<server.nb_monitor; ++j) - g_strfreev(server.monitor[j].names); + if (server.monitor[j].names) + g_strfreev(server.monitor[j].names); server.nb_monitor = i; server.monitor = realloc(server.monitor, server.nb_monitor * sizeof(Monitor)); qsort(server.monitor, server.nb_monitor, sizeof(Monitor), compareMonitorPos);

@@ -324,6 +317,7 @@ server.monitor = malloc(sizeof(Monitor));

server.monitor[0].x = server.monitor[0].y = 0; server.monitor[0].width = DisplayWidth (server.dsp, server.screen); server.monitor[0].height = DisplayHeight (server.dsp, server.screen); + server.monitor[0].names = 0; } }
M src/taskbar/taskbar.csrc/taskbar/taskbar.c

@@ -39,6 +39,9 @@ contains to every Task* on each panel a pointer (i.e. GPtrArray.len == server.nb_desktop)

*/ 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); }

@@ -50,6 +53,9 @@ int i, j;

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];
M src/taskbar/taskbar.hsrc/taskbar/taskbar.h

@@ -11,6 +11,9 @@

#include "task.h" extern GHashTable* win_to_task_table; +extern Task *task_active; +extern Task *task_drag; + // tint2 use one taskbar per desktop. typedef struct { // always start with area