From d83cf10196d0b3dbe4c543d77a711a16d29cca81 Mon Sep 17 00:00:00 2001 From: Thierry Lorthiois Date: Sun, 24 Oct 2010 12:41:35 +0000 Subject: [PATCH] fixed taskbar redrawing when pos/size changed --- src/taskbar/taskbar.c | 16 ++++++++++++++++ src/taskbar/taskbar.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/taskbar/taskbar.c b/src/taskbar/taskbar.c index 87c7bd4..2c5b748 100644 --- a/src/taskbar/taskbar.c +++ b/src/taskbar/taskbar.c @@ -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; kstate_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]; diff --git a/src/taskbar/taskbar.h b/src/taskbar/taskbar.h index 9944f15..52a7be0 100644 --- a/src/taskbar/taskbar.h +++ b/src/taskbar/taskbar.h @@ -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 -- 2.45.2