]> Dogcows Code - chaz/tint2/commitdiff
fixed issue 45, segfault without clock
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sat, 14 Feb 2009 20:11:37 +0000 (20:11 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sat, 14 Feb 2009 20:11:37 +0000 (20:11 +0000)
src/Makefile
src/clock/clock.c
src/config.c
src/panel.c
src/panel.h
src/tint2
tintrc01
tintrc03

index c31fc32c18d43b1e26a7abd8c1374ef8f5d2d987..2dcd58b8791dac6b0f2198e810f789fe6a09a849 100644 (file)
@@ -1,6 +1,6 @@
 CFLAGS= -O2
 CC = gcc
-FLAGS=-W -g `pkg-config --cflags --libs cairo pangocairo x11 xinerama imlib2 glib-2.0`
+FLAGS=-Wall -g `pkg-config --cflags --libs cairo pangocairo x11 xinerama imlib2 glib-2.0`
 PROGNAME=tint2
 FILES=tint.c server.c panel.c config.c taskbar/task.c taskbar/taskbar.c clock/clock.c systray/systraybar.c util/window.c util/area.c
 
@@ -23,7 +23,7 @@ endif
 
 $(PROGNAME): $(FILES) $(SYSTRAYOBJ)
        $(CC) $(CFLAGS) -I. -Iutil -Iclock -Itaskbar -Isystray -o $(PROGNAME) $(FILES) $(FLAGS)
-       strip $(PROGNAME)
+       #strip $(PROGNAME)
 
 install:
        mkdir -p $(BINDIR)
index 35fb595d29c62868791aea889d5ed0668dec6c7e..720d4980dd2955e74161e3bc2d35087fac5ba458 100644 (file)
@@ -48,12 +48,10 @@ void init_clock(Clock *clock, Area *parent)
 
        clock->area.parent = parent;
        clock->area.panel = panel;
-   clock->area._draw_foreground = draw_foreground_clock;
-   clock->area._resize = resize_clock;
    if (!time1_format) return;
 
-       // add clock to the panel
-       panel->area.list = g_slist_append(panel->area.list, clock);
+   clock->area._draw_foreground = draw_foreground_clock;
+   clock->area._resize = resize_clock;
 
    if (strchr(time1_format, 'S') == NULL) time_precision = 60;
    else time_precision = 1;
index f93faf572a124de89d77c86b04985f3eba1e6a5f..5ef34640d776c19d3b4e271224d43056a380ec35 100644 (file)
@@ -573,7 +573,8 @@ void config_finish ()
    // force the resize
        for (i=0 ; i < nb_panel ; i++) {
           panel1[i].area.resize = 1;
-          resize_clock(&panel1[i].clock);
+          if (time1_format)
+                  resize_clock(&panel1[i].clock);
        }
 
    init_taskbar();
index b12f58a4f1d46c1f9f36dd7508089333a0f55477..35cdd8ac7ac81ae34afaf2bc946f1feca9250ed4 100644 (file)
@@ -66,6 +66,12 @@ void init_panel()
                p->g_taskbar.panel = p;
                p->g_task.area.panel = p;
 
+               // add childs
+          if (time1_format)
+                       p->area.list = g_slist_append(p->area.list, &p->clock);
+               //panel->area.list = g_slist_append(panel->area.list, &panel->trayer);
+
+               // detect panel size
                if (p->pourcentx)
                        p->area.width = (float)server.monitor[p->monitor].width * p->initial_width / 100;
                else
@@ -75,7 +81,6 @@ void init_panel()
                else
                        p->area.height = p->initial_height;
 
-
                // full width mode
                if (!p->area.width)
                        p->area.width = server.monitor[p->monitor].width;
@@ -139,12 +144,6 @@ void cleanup_panel()
        for (i=0 ; i < nb_panel ; i++) {
                p = &panel1[i];
 
-               // freed list of visible objects
-               if (p->list_visible) {
-                       g_slist_free(p->list_visible);
-                       p->list_visible = 0;
-               }
-
                free_area(&p->area);
           free_area(&p->g_task.area);
           free_area(&p->g_taskbar);
@@ -220,8 +219,6 @@ void visible_object()
                else
                        panel->clock.area.visible = 0;
 
-               //panel->area.list = g_slist_append(panel->area.list, &panel->trayer);
-
                Taskbar *taskbar;
                for (j=0 ; j < panel->nb_desktop ; j++) {
                        taskbar = &panel->taskbar[j];
index 64ffcdb93d862fa5eae01004807187cd2c6c34c1..8bc64b722dd81dddf382597b51d78ac7ede082b3 100644 (file)
@@ -49,9 +49,6 @@ typedef struct {
    // area.list own all objects of the panel according to config file
    Area area;
 
-   // list of visible objects
-   GSList *list_visible;
-
    // --------------------------------------------------
    // panel
    Window main_win;
index 42b93978427e2480b91fa3d7d7b1c006630614b3..df19901eac6ddfe67bf33201a4739d4911460068 100755 (executable)
Binary files a/src/tint2 and b/src/tint2 differ
index ccec170b55d2ef10ab1d0f65801f826d1d5212fb..5f58688dc1f0d0f1c37ad6e0bee78a5da8aff8bf 100644 (file)
--- a/tintrc01
+++ b/tintrc01
@@ -25,7 +25,7 @@ border_color = #ffffff 70
 #---------------------------------------------
 panel_monitor = all
 panel_position = bottom center
-panel_size = 90% 28
+panel_size = 88% 28
 panel_margin = 0 0
 panel_padding = 7 0
 font_shadow = 0
index 357c00a2f3f1efce32580ada6b7173c80573ea29..5763ef0e13ce835c3370a97cc7aeaf741aad57c2 100644 (file)
--- a/tintrc03
+++ b/tintrc03
@@ -25,14 +25,14 @@ panel_size = 100% 30
 panel_margin = 0 0
 panel_padding = 6 0 6
 font_shadow = 0
-panel_background_id = 1
+panel_background_id = 0
 
 #---------------------------------------------
 # TASKBAR
 #---------------------------------------------
 taskbar_mode = multi_desktop
 taskbar_padding = 8 0 0
-taskbar_background_id = 0
+taskbar_background_id = 1
 
 #---------------------------------------------
 # TASKS
@@ -51,13 +51,13 @@ task_active_background_id = 2
 #---------------------------------------------
 # CLOCK
 #---------------------------------------------
-time1_format = %A %d %H:%M
+#time1_format = %A %d %H:%M
 time1_font = Dejavu sans 10
 #time2_format = %A %d %B
 time2_font = sans 7
 clock_font_color = #000000 80
 clock_padding = 8 0
-clock_background_id = 0
+clock_background_id = 1
 
 #---------------------------------------------
 # MOUSE ACTION ON TASK
This page took 0.032323 seconds and 4 git commands to generate.