]> Dogcows Code - chaz/tint2/blobdiff - src/util/area.c
fixed bug : clock resize when date changed, number of desktop changed
[chaz/tint2] / src / util / area.c
index bd6cf95f282f0fdde5ee4efa9bc758e94d463cc6..7606679b3446a65914a3a6a0d83ed33e8d7a3903 100644 (file)
 
 void refresh (Area *a)
 {
+   if (a->resize) {
+       // resize can generate a redraw
+          if (a->_resize)
+       a->_resize(a);
+      a->resize = 0;
+       }
+
    if (a->redraw) {
       //printf("draw pix\n");
       draw(a, 0);
@@ -61,6 +68,16 @@ void set_redraw (Area *a)
 }
 
 
+void set_resize (Area *a)
+{
+   a->resize = 1;
+
+   GSList *l;
+   for (l = a->list ; l ; l = l->next)
+      set_resize(l->data);
+}
+
+
 void draw (Area *a, int active)
 {
    Pixmap *pmap = (active == 0) ? (&a->pix.pmap) : (&a->pix_active.pmap);
@@ -80,8 +97,8 @@ void draw (Area *a, int active)
 
    draw_background (a, c, active);
 
-   if (a->draw_foreground)
-      a->draw_foreground(a, c, active);
+   if (a->_draw_foreground)
+      a->_draw_foreground(a, c, active);
 
    cairo_destroy (c);
    cairo_surface_destroy (cs);
@@ -180,6 +197,8 @@ void free_area (Area *a)
       g_slist_free(a->list);
       a->list = 0;
    }
+   if (a->pix.pmap) XFreePixmap (server.dsp, a->pix.pmap);
+   if (a->pix_active.pmap) XFreePixmap (server.dsp, a->pix_active.pmap);
 }
 
 
This page took 0.022517 seconds and 4 git commands to generate.