From 8ed6d60a25e5e14cce7219e0d5690381c61c60d1 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sat, 7 Nov 2009 20:36:56 +0100 Subject: [PATCH] wibox: make sure no garbage is painted to the screen Wiboxes are lazily updated. This means that we could receive an expose event on them between making them visible and actually painting their content. Due to this we were copying undefined content to the wibox, because the pixmap was only created just now, but it wasn't actually filled with anything yet. Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- event.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index 24b2b0f09..8ba4f04e4 100644 --- a/event.c +++ b/event.c @@ -539,7 +539,10 @@ event_handle_expose(void *data __attribute__ ((unused)), { wibox_t *wibox; - if((wibox = wibox_getbywin(ev->window))) + /* If the wibox got need_update set, skip this because it will be repainted + * soon anyway. Without this we could be painting garbage to the screen! + */ + if((wibox = wibox_getbywin(ev->window)) && !wibox->need_update) wibox_refresh_pixmap_partial(wibox, ev->x, ev->y, ev->width, ev->height);