From 3af636c3e6508863b57f256808f9401bb31b3ffc Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 9 Dec 2008 16:23:39 +0100 Subject: [PATCH] wibox: setvisible checks for screen Signed-off-by: Julien Danjou --- wibox.c | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/wibox.c b/wibox.c index 50e8ed7d7..ab3a1adcb 100644 --- a/wibox.c +++ b/wibox.c @@ -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]); } }