]> Dogcows Code - chaz/tint2/commitdiff
fixed issue 97 and issue 95
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Mon, 8 Jun 2009 18:49:50 +0000 (18:49 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Mon, 8 Jun 2009 18:49:50 +0000 (18:49 +0000)
ChangeLog
src/battery/battery.c
src/clock/clock.c
src/tint.c

index 9fa021cd177cfbcde4623d4fd0ed54b71c2e91a4..c461292b621dedd40eb0504b4ca84ff1f0e6822c 100644 (file)
--- 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'
 
index f0bb1ff0a0749efa3cf24c583065d230c17e6b58..222fbc5e1338634936a6ebac5f3edc19ef0aa937 100644 (file)
@@ -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;
        }
index a3061cb206919800ae04c1d4b0eb38c8e24b66d7..7bb67a726a8c69f51109929920e601c6b86bed1b 100644 (file)
@@ -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;
    }
index 1030b56fae21bbb0b29dc8912e8b0dbd0e4eb176..96ac0a01a9cbf16a2ea069f1378cb040b725edb2 100644 (file)
@@ -620,7 +620,7 @@ load_config:
             }
          }
       }
-      else event_timer();
+      event_timer();
 
                switch (signal_pending) {
                        case SIGUSR1:
This page took 0.033551 seconds and 4 git commands to generate.