]> Dogcows Code - chaz/tint2/commitdiff
fixed taskbar redrawing when pos/size changed
authorThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 24 Oct 2010 12:41:35 +0000 (12:41 +0000)
committerThierry Lorthiois <lorthiois@bbsoft.fr>
Sun, 24 Oct 2010 12:41:35 +0000 (12:41 +0000)
src/taskbar/taskbar.c
src/taskbar/taskbar.h

index 87c7bd495dbf80d5e17c828155a69e140eb70e21..2c5b7484d3f15cce7f73d022d4ba63674dafb141 100644 (file)
@@ -113,6 +113,7 @@ void init_taskbar_panel(void *p)
        panel->g_taskbar.area.size_mode = SIZE_BY_LAYOUT;
        panel->g_taskbar.area._resize = resize_taskbar;
        panel->g_taskbar.area._draw_foreground = draw_taskbar;
+       panel->g_taskbar.area._on_change_layout = on_change_taskbar;
        panel->g_taskbar.area.redraw = 1;
        panel->g_taskbar.area.on_screen = 1;
        if (panel_horizontal) {
@@ -299,6 +300,21 @@ int resize_taskbar(void *obj)
 }
 
 
+void on_change_taskbar (void *obj)
+{
+       Taskbar *tskbar = obj;
+       int k;
+
+       // reset Pixmap when position/size changed
+       for (k=0; k<TASKBAR_STATE_COUNT; ++k) {
+               if (tskbar->state_pix[k]) XFreePixmap(server.dsp, tskbar->state_pix[k]);
+               tskbar->state_pix[k] = 0;
+       }
+       tskbar->area.pix = 0;
+       tskbar->area.redraw = 1;
+}
+
+
 void set_taskbar_state(Taskbar *tskbar, int state)
 {
        tskbar->area.bg = panel1[0].g_taskbar.background[state];
index 9944f15ceec7a833f8c490288152eb268c9ad6e3..52a7be0f153c831554a0d53c37f43debc7fb2280 100644 (file)
@@ -52,6 +52,7 @@ GPtrArray* task_get_tasks(Window win);
 void task_refresh_tasklist ();
 
 int  resize_taskbar(void *obj);
+void on_change_taskbar (void *obj);
 void set_taskbar_state(Taskbar *tskbar, int state);
 
 // show/hide taskbar according to current desktop
This page took 0.025247 seconds and 4 git commands to generate.