fixed issue 45, segfault without clock git-svn-id: http://tint2.googlecode.com/svn/trunk@55 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
lorthiois@bbsoft.fr lorthiois@bbsoft.fr@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
8 files changed,
17 insertions(+),
24 deletions(-)
M
src/Makefile
→
src/Makefile
@@ -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 @@
$(PROGNAME): $(FILES) $(SYSTRAYOBJ) $(CC) $(CFLAGS) -I. -Iutil -Iclock -Itaskbar -Isystray -o $(PROGNAME) $(FILES) $(FLAGS) - strip $(PROGNAME) + #strip $(PROGNAME) install: mkdir -p $(BINDIR)
M
src/clock/clock.c
→
src/clock/clock.c
@@ -48,12 +48,10 @@ int time_height, time_height_ink, date_height, date_height_ink;
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;
M
src/config.c
→
src/config.c
@@ -573,7 +573,8 @@ init_panel();
// 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();
M
src/panel.c
→
src/panel.c
@@ -66,6 +66,12 @@ p->g_taskbar.parent = p;
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@@ -74,7 +80,6 @@ if (p->pourcenty)
p->area.height = (float)server.monitor[p->monitor].height * p->initial_height / 100; else p->area.height = p->initial_height; - // full width mode if (!p->area.width)@@ -139,12 +144,6 @@ Panel *p;
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);@@ -219,8 +218,6 @@ if (time1_format)
panel->clock.area.visible = 1; 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++) {
M
src/panel.h
→
src/panel.h
@@ -49,9 +49,6 @@ // always start with area
// 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;
M
tintrc03
→
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 @@
#--------------------------------------------- # 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