geom indicator and layout indicator is only displayed if there are several geoms/layouts a6a216f2
Anselm R Garbe · 2008-03-24 13:33 2 file(s) · +15 −12
config.def.h +1 −4
15 15
16 16
Rule rules[] = {
17 17
	/* class	instance	title		tags ref	isfloating */
18 -
	{ NULL,		NULL,		"Firefox",	tags[8],	False },
19 -
	{ NULL,		NULL,		"Gimp",		NULL,		True },
20 -
	{ NULL,		NULL,		"MPlayer",	NULL,		True },
21 -
	{ NULL,		NULL,		"Acroread",	NULL,		True },
18 +
	{ "Gimp",	NULL,		NULL,		NULL,		True },
22 19
};
23 20
24 21
/* geometries, s{x,y,w,h} and bh are already initualized here */
dwm.c +14 −8
517 517
	Client *c;
518 518
519 519
	dc.x = 0;
520 -
	dc.w = bgw;
521 -
	drawtext(geom->symbol, dc.norm, False);
522 -
	dc.x += bgw;
520 +
	if(bgw > 0) {
521 +
		dc.w = bgw;
522 +
		drawtext(geom->symbol, dc.norm, False);
523 +
		dc.x += bgw;
524 +
	}
523 525
	for(c = stack; c && !isvisible(c); c = c->snext);
524 526
	for(i = 0; i < LENGTH(tags); i++) {
525 527
		dc.w = textw(tags[i]);
533 535
		}
534 536
		dc.x += dc.w;
535 537
	}
536 -
	dc.w = blw;
537 -
	drawtext(lt->symbol, dc.norm, False);
538 -
	x = dc.x + dc.w;
538 +
	if(blw > 0) {
539 +
		dc.w = blw;
540 +
		drawtext(lt->symbol, dc.norm, False);
541 +
		x = dc.x + dc.w;
542 +
	}
543 +
	else
544 +
		x = dc.x;
539 545
	dc.w = textw(stext);
540 546
	dc.x = bw - dc.w;
541 547
	if(dc.x < x) {
1502 1508
	lt = &layouts[0];
1503 1509
1504 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 1512
		w = textw(layouts[i].symbol);
1507 1513
		if(w > blw)
1508 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 1517
		w = textw(geoms[i].symbol);
1512 1518
		if(w > bgw)
1513 1519
			bgw = w;