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 <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Uli Schlachter 2009-11-07 20:36:56 +01:00 committed by Julien Danjou
parent 12977febee
commit 8ed6d60a25
1 changed files with 4 additions and 1 deletions

View File

@ -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);