summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-03-24 13:33:32 +0000
committerAnselm R Garbe <garbeam@gmail.com>2008-03-24 13:33:32 +0000
commita6a216f28cbc49afaace269c2662382a351fda24 (patch)
tree2fc807155a2f7fc8d357e8fb3b1e80081b720b8b /dwm.c
parenthotfix of idxoftag (diff)
downloaddwm-a6a216f28cbc49afaace269c2662382a351fda24.tar.gz
dwm-a6a216f28cbc49afaace269c2662382a351fda24.zip
geom indicator and layout indicator is only displayed if there are several geoms/layouts
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/dwm.c b/dwm.c
index 0e72c47..54d021f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -517,9 +517,11 @@ drawbar(void) {
517 Client *c; 517 Client *c;
518 518
519 dc.x = 0; 519 dc.x = 0;
520 dc.w = bgw; 520 if(bgw > 0) {
521 drawtext(geom->symbol, dc.norm, False); 521 dc.w = bgw;
522 dc.x += bgw; 522 drawtext(geom->symbol, dc.norm, False);
523 dc.x += bgw;
524 }
523 for(c = stack; c && !isvisible(c); c = c->snext); 525 for(c = stack; c && !isvisible(c); c = c->snext);
524 for(i = 0; i < LENGTH(tags); i++) { 526 for(i = 0; i < LENGTH(tags); i++) {
525 dc.w = textw(tags[i]); 527 dc.w = textw(tags[i]);
@@ -533,9 +535,13 @@ drawbar(void) {
533 } 535 }
534 dc.x += dc.w; 536 dc.x += dc.w;
535 } 537 }
536 dc.w = blw; 538 if(blw > 0) {
537 drawtext(lt->symbol, dc.norm, False); 539 dc.w = blw;
538 x = dc.x + dc.w; 540 drawtext(lt->symbol, dc.norm, False);
541 x = dc.x + dc.w;
542 }
543 else
544 x = dc.x;
539 dc.w = textw(stext); 545 dc.w = textw(stext);
540 dc.x = bw - dc.w; 546 dc.x = bw - dc.w;
541 if(dc.x < x) { 547 if(dc.x < x) {
@@ -1502,12 +1508,12 @@ setup(void) {
1502 lt = &layouts[0]; 1508 lt = &layouts[0];
1503 1509
1504 /* init bar */ 1510 /* init bar */
1505 for(blw = i = 0; i < LENGTH(layouts); i++) { 1511 for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
1506 w = textw(layouts[i].symbol); 1512 w = textw(layouts[i].symbol);
1507 if(w > blw) 1513 if(w > blw)
1508 blw = w; 1514 blw = w;
1509 } 1515 }
1510 for(bgw = i = 0; i < LENGTH(geoms); i++) { 1516 for(bgw = i = 0; LENGTH(geoms) > 1 && i < LENGTH(geoms); i++) {
1511 w = textw(geoms[i].symbol); 1517 w = textw(geoms[i].symbol);
1512 if(w > bgw) 1518 if(w > bgw)
1513 bgw = w; 1519 bgw = w;