dwm-meillo

diff view.c @ 674:5d79c351e30a

implemented nmaster appearance in mode label (using %u)
author Anselm R. Garbe <arg@suckless.org>
date Mon, 08 Jan 2007 17:33:24 +0100
parents 3e0f11a44293
children 1438e35b622e
line diff
     1.1 --- a/view.c	Mon Jan 08 13:01:37 2007 +0100
     1.2 +++ b/view.c	Mon Jan 08 17:33:24 2007 +0100
     1.3 @@ -2,6 +2,7 @@
     1.4   * See LICENSE file for license details.
     1.5   */
     1.6  #include "dwm.h"
     1.7 +#include <stdio.h>
     1.8  
     1.9  /* static */
    1.10  
    1.11 @@ -149,10 +150,15 @@
    1.12  
    1.13  void
    1.14  incnmaster(Arg *arg) {
    1.15 -	if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
    1.16 +	if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
    1.17  		return;
    1.18  	nmaster += arg->i;
    1.19 -	arrange();
    1.20 +	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
    1.21 +	bmw = textw(mtext);
    1.22 +	if(sel)
    1.23 +		arrange();
    1.24 +	else
    1.25 +		drawstatus();
    1.26  }
    1.27  
    1.28  Bool
    1.29 @@ -218,6 +224,8 @@
    1.30  void
    1.31  togglemode(Arg *arg) {
    1.32  	arrange = (arrange == dofloat) ? dotile : dofloat;
    1.33 +	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
    1.34 +	bmw = textw(mtext);
    1.35  	if(sel)
    1.36  		arrange();
    1.37  	else