]> Dogcows Code - chaz/tint2/commitdiff
fixed segfault with icon
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 12 Nov 2008 23:23:15 +0000 (23:23 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Wed, 12 Nov 2008 23:23:15 +0000 (23:23 +0000)
ChangeLog
src/taskbar/task.c
src/tint2
tintrc06

index aff06a32af563ced9d5e82756e4bdedec87f5561..d06bbdf6e05a7975b4b82039c57346b04b3a8e78 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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, ...)
 
index 3c4e6ed3d11d13e82dc607b097f6e2094d9e8047..4115cbe6d84baaa2f52370e8278be111a8ef16ef 100644 (file)
@@ -60,8 +60,14 @@ void add_task (Window win)
    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 @@ void remove_task (Task *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 @@ void get_title(Task *tsk)
 
    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 @@ void get_title(Task *tsk)
    }
 
    // 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;
 }
 
index fcc2f2dd82a54beebe0b02a89726ec73a341f9b7..04154da944639c0a0d98abb6472f7252aa117b84 100755 (executable)
Binary files a/src/tint2 and b/src/tint2 differ
index 741bb8b7e9f75c5e5a8cb7435164602fa7f905cc..9cc94bbadb1a2fb1ce19aa912fbadfd6e432bb4f 100644 (file)
--- a/tintrc06
+++ b/tintrc06
@@ -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 @@ border_color = #ffffff 70
 #---------------------------------------------
 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
 
This page took 0.026825 seconds and 4 git commands to generate.