From bdf2b082bfec6b97db162249fe2d108d8b973ffa Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Mon, 13 Apr 2009 15:32:41 +0200 Subject: [PATCH] layout: rearrange ban/unban sequence to avoid seeing the background during tag switch Signed-off-by: Julien Danjou --- layout.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/layout.c b/layout.c index 87dca76ac..067ffad34 100644 --- a/layout.c +++ b/layout.c @@ -47,13 +47,22 @@ arrange(int screen) /* Restore titlebar before client, so geometry is ok again. */ if(titlebar_isvisible(c, screen)) titlebar_unban(c->titlebar); - else if(c->screen == screen) - titlebar_ban(c->titlebar); if(client_isvisible(c, screen)) client_unban(c); + } + + /* Some people disliked the short flicker of background, so we first unban everything. + * Afterwards we ban everything we don't want. This should avoid that. */ + foreach(_c, globalconf.clients) + { + client_t *c = *_c; + + if(!titlebar_isvisible(c, screen) && c->screen == screen) + titlebar_ban(c->titlebar); + /* we don't touch other screens windows */ - else if(c->screen == screen) + if(!client_isvisible(c, screen) && c->screen == screen) client_ban(c); }