layout: Fix nmaster

This commit is contained in:
Martin Duquesnoy 2008-10-30 19:40:50 +01:00
parent d330003e77
commit f41a145a4c
3 changed files with 12 additions and 6 deletions

View File

@ -126,8 +126,12 @@ updatebar(void)
sprintf(buf, "mwfact: %.2f - nmaster: %d",
tags[seltag].mwfact,
tags[seltag].nmaster);
draw_text(bar->dr, taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + conf.tagbordwidth + PAD,
fonth, conf.colors.text, conf.colors.bar, 0, buf);
draw_text(bar->dr,
taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + conf.tagbordwidth + PAD,
fonth, conf.colors.text, conf.colors.bar, 0, buf);
draw_rectangle(bar->dr,
taglen[conf.ntag] + textw(tags[seltag].layout.symbol) + textw(buf) + PAD * 2,
0, conf.tagbordwidth, barheight, conf.colors.tagbord);
/* Draw status text */
draw_text(bar->dr, mw - textw(bartext), fonth, conf.colors.text, conf.colors.bar, 0, bartext);

View File

@ -127,13 +127,11 @@ client_focus(Client *c)
XSetWindowBorder(dpy, sel->win, conf.client.bordernormal);
}
if(c)
grabbuttons(c, True);
selbytag[seltag] = sel = c;
if(c)
{
grabbuttons(c, True);
XSetWindowBorder(dpy, c->win, conf.client.borderfocus);
if(conf.raisefocus)
client_raise(c);
@ -142,6 +140,7 @@ client_focus(Client *c)
else
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
/* Update all visible titlebar */
for(cc = clients; cc; cc = cc->next)
if(!ishide(cc))
titlebar_update(cc);

View File

@ -200,9 +200,12 @@ multi_tile(Position type)
int i, border = conf.client.borderheight * 2;
for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), ++n);
if(!n || n < nmaster)
if(!n)
return;
/* FIX NMASTER */
nmaster = (n < nmaster) ? n : nmaster;
/* SET MWFACT */
mwfact = (type == Top || type == Bottom)
? tags[seltag].mwfact * sgeo.height