all repos — tint2 @ 500981b05203f06c181a099106e1ba2b98672684

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

panel_items : fixed some segfault.

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

500981b05203f06c181a099106e1ba2b98672684

parent

3791486704b1013716bc44aadc959ff32bac520e

4 files changed, 21 insertions(+), 22 deletions(-)

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

@@ -73,17 +73,20 @@ for (i=0 ; i < nb_panel ; i++) {

if (battery_state.percentage >= percentage_hide) { if (panel1[i].battery.area.on_screen == 1) { panel1[i].battery.area.on_screen = 0; + panel1[i].area.resize = 1; panel_refresh = 1; } - continue; } else { if (panel1[i].battery.area.on_screen == 0) { panel1[i].battery.area.on_screen = 1; - panel_refresh = 1; + panel1[i].area.resize = 1; } } - panel1[i].battery.area.resize = 1; + if (panel1[i].battery.area.on_screen == 1) { + panel1[i].battery.area.resize = 1; + panel_refresh = 1; + } } }

@@ -448,7 +451,6 @@ int percentage_width, time_width, new_width, ret = 0;

percentage_width = time_width = 0; battery->area.redraw = 1; - snprintf(buf_bat_percentage, sizeof(buf_bat_percentage), "%d%%", battery_state.percentage); if(battery_state.state == BATTERY_FULL) { strcpy(buf_bat_time, "Full");
M src/clock/clock.csrc/clock/clock.c

@@ -151,8 +151,11 @@ clock->area.size_mode = SIZE_BY_CONTENT;

clock->area._resize = resize_clock; clock->area.resize = 1; clock->area.redraw = 1; - clock->area.on_screen = 1; + // check consistency + if (time1_format == 0) + return; + clock->area.on_screen = 1; strftime(buf_time, sizeof(buf_time), time1_format, clock_gettime_for_tz(time1_timezone)); get_text_size(time1_font_desc, &time_height_ink, &time_height, panel->area.height, buf_time, strlen(buf_time)); if (time2_format) {

@@ -167,8 +170,6 @@ clock->area.height = panel->area.height - (2 * clock->area.posy);

} else { // panel vertical => fixed width, height, posy and posx -// clock->area.posy = panel->area.bg->border.width + panel->area.paddingxlr; -// clock->area.height = (2 * clock->area.paddingxlr) + (time_height + date_height); clock->area.posx = panel->area.bg->border.width + panel->area.paddingy; clock->area.width = panel->area.width - (2 * panel->area.bg->border.width) - (2 * panel->area.paddingy); }

@@ -236,7 +237,11 @@ if (time2_format)

strftime(buf_date, sizeof(buf_date), time2_format, clock_gettime_for_tz(time2_timezone)); // vertical panel doen't adjust width - if (!panel_horizontal) return ret; + if (!panel_horizontal) { +// clock->area.posy = panel->area.bg->border.width + panel->area.paddingxlr; +// clock->area.height = (2 * clock->area.paddingxlr) + (time_height + date_height); + return ret; + } //printf(" resize_clock\n"); cairo_surface_t *cs;
M src/launcher/launcher.csrc/launcher/launcher.c

@@ -70,8 +70,12 @@ launcher->area.size_mode = SIZE_BY_CONTENT;

launcher->area._resize = resize_launcher; launcher->area.resize = 1; launcher->area.redraw = 1; - launcher->area.on_screen = 1; + // check consistency + if (launcher->list_apps == NULL) + return; + + launcher->area.on_screen = 1; if (panel_horizontal) { // panel horizonal => fixed height and posy launcher->area.posy = panel->area.bg->border.width + panel->area.paddingy;

@@ -148,6 +152,7 @@ launcher->list_apps = launcher->list_icons = launcher->icon_theme_names = launcher->icon_themes = NULL;

} launcher_enabled = 0; } + int resize_launcher(void *obj) {

@@ -222,9 +227,6 @@ marging = height - (icons_per_column-1)*(icon_size+launcher->area.paddingx) - icon_size;

icons_per_row = count / icons_per_column + (count%icons_per_column != 0); launcher->area.width = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_row) + ((icons_per_row-1) * launcher->area.paddingx); } - -// launcher->area.posx = panel->area.bg->border.width + panel->area.paddingxlr; - launcher->area.posy = panel->area.bg->border.width; } else { if (!count) launcher->area.height = 0;

@@ -236,9 +238,6 @@ marging = width - (icons_per_row-1)*(icon_size+launcher->area.paddingx) - icon_size;

icons_per_column = count / icons_per_row+ (count%icons_per_row != 0); launcher->area.height = (2 * launcher->area.bg->border.width) + (2 * launcher->area.paddingxlr) + (icon_size * icons_per_column) + ((icons_per_column-1) * launcher->area.paddingx); } - - launcher->area.posx = panel->area.bg->border.width; -// launcher->area.posy = panel->area.height - panel->area.bg->border.width - panel->area.paddingxlr - launcher->area.height; } int i, posx, posy;
M src/util/area.csrc/util/area.c

@@ -68,13 +68,6 @@ * 'panel_items' parameter (in config) define the list and the order of nodes in tree's panel.

* 'panel_items = SC' define a panel with just Systray and Clock. * So the tree 'Panel.Area' will have 2 childs (Systray and Clock). * - * 1) ok - * 2) ?? - * 3) ?? - * répartition entre niveau global et niveau local ?? - * size_by_content peut-il modifier redraw=1 en cas de changement ? ou est ce géré par chaque composant ? - * size_by_layout peut-il modifier redraw ? - * ************************************************************/ void rendering(void *obj)