wibox: setvisible checks for screen

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-12-09 16:23:39 +01:00
parent a760f4b0bc
commit 3af636c3e6

35
wibox.c
View file

@ -521,23 +521,28 @@ wibox_setvisible(wibox_t *wibox, bool v)
{
if(v != wibox->isvisible)
{
if((wibox->isvisible = v))
wibox->isvisible = v;
if(wibox->screen != SCREEN_UNDEF)
{
xcb_map_window(globalconf.connection, wibox->sw.window);
simplewindow_refresh_pixmap(&wibox->sw);
/* stack correctly the wibox */
client_stack();
if(wibox->isvisible)
{
xcb_map_window(globalconf.connection, wibox->sw.window);
simplewindow_refresh_pixmap(&wibox->sw);
/* stack correctly the wibox */
client_stack();
}
else
xcb_unmap_window(globalconf.connection, wibox->sw.window);
/* kick out systray if needed */
wibox_systray_refresh(wibox);
/* All the other wibox and ourselves need to be repositioned */
wibox_array_t *w = &globalconf.screens[wibox->screen].wiboxes;
for(int i = 0; i < w->len; i++)
wibox_position_update(w->tab[i]);
}
else
xcb_unmap_window(globalconf.connection, wibox->sw.window);
/* kick out systray if needed */
wibox_systray_refresh(wibox);
/* All the other wibox and ourselves need to be repositioned */
wibox_array_t *w = &globalconf.screens[wibox->screen].wiboxes;
for(int i = 0; i < w->len; i++)
wibox_position_update(w->tab[i]);
}
}