Make sure a wibox does not display garbage when made visible
This moves the call to wibox_draw() into wibox_map() which fixes garbage being displayed if a wibox is made visible by setting its .visible. Since wibox_draw() already calls simplewindow_refresh_pixmap(), that call is dropped. Because wibox_need_update() just makes sure wibox_draw() is later called, we can replace the call to wibox_draw() by this call. This should avoid superflous updates. Found by lua code like this: local w = wibox({ position = "floating", bg = "#ff0000" }) w.visible = false w.screen = 1 <do some other stuff> w.visible = true Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
ff34fd2f3b
commit
dc82832ccf
7
wibox.c
7
wibox.c
|
@ -43,7 +43,8 @@ static void
|
||||||
wibox_map(wibox_t *wibox)
|
wibox_map(wibox_t *wibox)
|
||||||
{
|
{
|
||||||
xcb_map_window(globalconf.connection, wibox->sw.window);
|
xcb_map_window(globalconf.connection, wibox->sw.window);
|
||||||
simplewindow_refresh_pixmap(&wibox->sw);
|
/* We must make sure the wibox does not display garbage */
|
||||||
|
wibox_need_update(wibox);
|
||||||
/* Stack this wibox correctly */
|
/* Stack this wibox correctly */
|
||||||
client_stack();
|
client_stack();
|
||||||
}
|
}
|
||||||
|
@ -666,11 +667,7 @@ wibox_attach(wibox_t *wibox, screen_t *s)
|
||||||
ewmh_update_workarea(screen_virttophys(s->index));
|
ewmh_update_workarea(screen_virttophys(s->index));
|
||||||
|
|
||||||
if(wibox->isvisible)
|
if(wibox->isvisible)
|
||||||
{
|
|
||||||
/* draw it right now once to avoid garbage shown */
|
|
||||||
wibox_draw(wibox);
|
|
||||||
wibox_map(wibox);
|
wibox_map(wibox);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
wibox_need_update(wibox);
|
wibox_need_update(wibox);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue