From c317afc79dff114be4eda71b41ad24b5993f8d00 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Mon, 10 Jan 2011 20:39:14 +0100 Subject: [PATCH] Re-arrange code for fix #67 (avoid code duplication) --- src/client.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/client.c b/src/client.c index b5653b2..7405558 100644 --- a/src/client.c +++ b/src/client.c @@ -1247,31 +1247,33 @@ client_unmanage(Client *c) XUngrabServer(dpy); ewmh_get_client_list(); - /* Arrange */ - for(i = 0; i < screen_count() && !b; ++i) - if(c->tag == MAXTAG + 1 || c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) - b = True; - if(b) + if(c->tag == MAXTAG + 1) { - if(c->tag == MAXTAG + 1) - { - if(c->tag == MAXTAG+1){ - for(i = 0; i < conf.ntag[c->screen]; i++) - tags[c->screen][i].request_update = True; - tags[c->screen][seltag[c->screen]].layout.func(c->screen); - } - } - else - tags[c->screen][c->tag].layout.func(c->screen); + for(i = 0; i < conf.ntag[c->screen]; i++) + tags[c->screen][i].request_update = True; + tags[c->screen][seltag[c->screen]].layout.func(c->screen); } else { - tags[c->screen][c->tag].request_update = True; - infobar_draw(c->screen); + /* Arrange */ + for(i = 0; i < screen_count() && !b; ++i) + if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) + b = True; + + if(b) + { + tags[c->screen][c->tag].layout.func(c->screen); + } + else + { + tags[c->screen][c->tag].request_update = True; + infobar_draw(c->screen); + } } + /*XFree(c->title);*/ client_focus_next(c);