From a0416a9abf252dc6c77f2542beb705a7a47422e5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 24 Oct 2008 11:57:01 +0200 Subject: [PATCH] wibox: draw before map to avoid artefacts Signed-off-by: Julien Danjou --- wibox.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/wibox.c b/wibox.c index b6c837f1c..5b74a6a45 100644 --- a/wibox.c +++ b/wibox.c @@ -593,16 +593,20 @@ wibox_attach(wibox_t *wibox, screen_t *s) simplewindow_border_color_set(&wibox->sw, &wibox->sw.border.color); - wibox->need_update = true; - - if(wibox->isvisible) - xcb_map_window(globalconf.connection, wibox->sw.window); - /* All the other wibox and ourselves need to be repositioned */ for(int i = 0; i < s->wiboxes.len; i++) wibox_position_update(s->wiboxes.tab[i]); ewmh_update_workarea(screen_virttophys(s->index)); + + if(wibox->isvisible) + { + /* draw it right now once to avoid garbage shown */ + wibox_draw(wibox); + xcb_map_window(globalconf.connection, wibox->sw.window); + } + else + wibox->need_update = true; }