all repos — tint2 @ d29f3771dec8a60d4438c44540915a0377126b4c

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

fixed segfault with icon

git-svn-id: http://tint2.googlecode.com/svn/trunk@20 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
commit

d29f3771dec8a60d4438c44540915a0377126b4c

parent

9707ec36d24a45a7830f3554eb5098cad941525b

4 files changed, 31 insertions(+), 13 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,6 @@

2008-11-12 +- fixed segfault with icon - panel's left and right padding feel like WM background (right click open window managers's menu, ...)
M src/taskbar/task.csrc/taskbar/task.c

@@ -60,8 +60,14 @@

XSelectInput (server.dsp, new_tsk->win, PropertyChangeMask|StructureNotifyMask); if (desktop == 0xFFFFFFFF) { - if (new_tsk->title) XFree (new_tsk->title); - if (new_tsk->icon_data) XFree (new_tsk->icon_data); + if (new_tsk->title) { + free (new_tsk->title); + new_tsk->title = 0; + } + if (new_tsk->icon_data) { + XFree (new_tsk->icon_data); + new_tsk->icon_data = 0; + } free(new_tsk); fprintf(stderr, "task on all desktop : ignored\n"); return;

@@ -87,8 +93,14 @@ tskbar->area.list = g_slist_remove(tskbar->area.list, tsk);

resize_tasks (tskbar); redraw (&tskbar->area); - if (tsk->title) XFree (tsk->title); - if (tsk->icon_data) XFree (tsk->icon_data); + if (tsk->title) { + free (tsk->title); + tsk->title = 0; + } + if (tsk->icon_data) { + XFree (tsk->icon_data); + tsk->icon_data = 0; + } XFreePixmap (server.dsp, tsk->area.pmap); XFreePixmap (server.dsp, tsk->area_active.pmap); free(tsk);

@@ -101,8 +113,6 @@ if (!g_task.text) return;

char *title, *name; - if (tsk->title) free(tsk->title); - name = server_get_property (tsk->win, server.atom._NET_WM_VISIBLE_NAME, server.atom.UTF8_STRING, 0); if (!name || !strlen(name)) { name = server_get_property (tsk->win, server.atom._NET_WM_NAME, server.atom.UTF8_STRING, 0);

@@ -116,12 +126,14 @@ }

} // add space before title - title = malloc(strlen(name)+1); + title = malloc(strlen(name)+2); if (g_task.icon) strcpy(title, " "); else title[0] = 0; strcat(title, name); - if (name) XFree (name); + + if (tsk->title) + free(tsk->title); tsk->title = title; }
M tintrc06tintrc06

@@ -11,9 +11,14 @@ background_color = #000000 45

border_color = #ffffff 0 rounded = 7 -border_width = 1 -background_color = #ffffff 0 -border_color = #ffffff 70 +border_width = 0 +background_color = #ffffff 20 +border_color = #ffffff 15 + +rounded = 0 +border_width = 0 +background_color = #000000 35 +border_color = #ffffff 0 #---------------------------------------------

@@ -21,7 +26,7 @@ # PANEL

#--------------------------------------------- panel_monitor = 1 panel_position = bottom left -panel_size = 1010 30 +panel_size = 0 30 panel_margin = 0 0 panel_padding = 11 2 font_shadow = 0

@@ -44,7 +49,7 @@ task_centered = 1

task_padding = 2 2 task_font = sans bold 8 task_font_color = #ffffff 60 -task_active_font_color = #ffffff 95 +task_active_font_color = #ffffff 85 task_background_id = 0 task_active_background_id = 2