From 985e8a8ae0792d1fc2b305830ced5514314473eb Mon Sep 17 00:00:00 2001 From: Thierry Lorthiois Date: Mon, 8 Jun 2009 18:49:50 +0000 Subject: [PATCH] fixed issue 97 and issue 95 --- ChangeLog | 3 +++ src/battery/battery.c | 27 ++++++++++++--------------- src/clock/clock.c | 6 ++---- src/tint.c | 2 +- 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9fa021c..c461292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2009-06-08 +- fixed issue 97 and issue 95 + 2009-06-08 - allow 'taskbar_mode = multi_desktop' config with 'panel_monitor = all' diff --git a/src/battery/battery.c b/src/battery/battery.c index f0bb1ff..222fbc5 100644 --- a/src/battery/battery.c +++ b/src/battery/battery.c @@ -255,6 +255,7 @@ void draw_battery (void *obj, cairo_t *c, int active) g_object_unref(layout); } + void resize_battery(void *obj) { Battery *battery = obj; @@ -292,23 +293,19 @@ void resize_battery(void *obj) new_width += (2*battery->area.paddingxlr) + (2*battery->area.pix.border.width); - if(new_width > battery->area.width || new_width < (battery->area.width-6)) { - int i; - Panel *panel = ((Area*)obj)->panel; - - printf("battery_width %d, new_width %d\n", battery->area.width, new_width); + int old_width = battery->area.width; - // resize battery - // we try to limit the number of resize - battery->area.width = new_width + 1; - battery->area.posx = panel->area.width - battery->area.width - panel->area.paddingxlr - panel->area.pix.border.width; - if (panel->clock.area.on_screen) - battery->area.posx -= (panel->clock.area.width + panel->area.paddingx); - - // resize other objects on panel - for (i=0 ; i < nb_panel ; i++) - panel1[i].area.resize = 1; + Panel *panel = ((Area*)obj)->panel; + battery->area.width = new_width + 1; + battery->area.posx = panel->area.width - battery->area.width - panel->area.paddingxlr - panel->area.pix.border.width; + if (panel->clock.area.on_screen) + battery->area.posx -= (panel->clock.area.width + panel->area.paddingx); + if(new_width > old_width || new_width < (old_width-6)) { + // refresh and resize other objects on panel + // we try to limit the number of refresh + printf("battery_width %d, new_width %d\n", battery->area.width, new_width); + panel->area.resize = 1; systray.area.resize = 1; panel_refresh = 1; } diff --git a/src/clock/clock.c b/src/clock/clock.c index a3061cb..7bb67a7 100644 --- a/src/clock/clock.c +++ b/src/clock/clock.c @@ -175,7 +175,6 @@ void resize_clock (void *obj) new_width += (2*clock->area.paddingxlr) + (2*clock->area.pix.border.width); if (new_width > clock->area.width || new_width < (clock->area.width-6)) { - int i; Panel *panel = ((Area*)obj)->panel; printf("clock_width %d, new_width %d\n", clock->area.width, new_width); @@ -185,9 +184,8 @@ void resize_clock (void *obj) clock->area.posx = panel->area.width - clock->area.width - panel->area.paddingxlr - panel->area.pix.border.width; // resize other objects on panel - for (i=0 ; i < nb_panel ; i++) { - panel1[i].area.resize = 1; - } + panel->area.resize = 1; + panel->battery.area.resize = 1; systray.area.resize = 1; panel_refresh = 1; } diff --git a/src/tint.c b/src/tint.c index 1030b56..96ac0a0 100644 --- a/src/tint.c +++ b/src/tint.c @@ -620,7 +620,7 @@ load_config: } } } - else event_timer(); + event_timer(); switch (signal_pending) { case SIGUSR1: -- 2.45.2