From 056d9a074b6e6c57edeb0570f2af9f06f3b5b0aa 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 ecc57ffe..a97d7891 100644 --- a/event.c +++ b/event.c @@ -528,7 +528,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);