diff --git a/src/client.c b/src/client.c index 8fb56d8..331c6d3 100644 --- a/src/client.c +++ b/src/client.c @@ -372,12 +372,12 @@ client_manage(Window w, XWindowAttributes *wa) mx += BORDH; my += TBARH; - if(mx == 0) + if(!mx) mx += BORDH; else if(mx == MAXW) mx -= wa->width + BORDH; - if(my == 0) + if(!my) my += TBARH + INFOBARH; else if(my == MAXH) my -= wa->height + BORDH; diff --git a/src/infobar.c b/src/infobar.c index 647504b..b7c2e97 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -124,30 +124,32 @@ void infobar_draw_taglist(int sc) { int i; + Client *c; for(i = 1; i < conf.ntag[sc] + 1; ++i) { - Client *c; - infobar[sc].tags[i]->color = ((i == seltag[sc]) ? conf.colors.tagselbg : conf.colors.bar); barwin_refresh_color(infobar[sc].tags[i]); + /* Colorize a tag if there are clients in this */ for(c = clients; c; c = c->next) { if(c->screen == sc) { - infobar[sc].tags[c->tag]->color = ((c->tag == seltag[sc]) ? conf.colors.tagselbg : conf.colors.tag_occupied_bg); + infobar[sc].tags[c->tag]->color = ((c->tag == seltag[sc]) + ? conf.colors.tagselbg + : conf.colors.tag_occupied_bg); barwin_refresh_color(infobar[sc].tags[i]); } } if(tags[sc][i].name) - draw_text(infobar[sc].tags[i]->dr, - PAD / 2, - font->height, - ((i == seltag[sc]) ? conf.colors.tagselfg : conf.colors.text), - 0, - tags[sc][i].name); + draw_text(infobar[sc].tags[i]->dr, + PAD / 2, + font->height, + ((i == seltag[sc]) ? conf.colors.tagselfg : conf.colors.text), + 0, + tags[sc][i].name); barwin_refresh(infobar[sc].tags[i]); }