aewl

changeset 675:1438e35b622e

reorganized
author Anselm R. Garbe <arg@suckless.org>
date Mon, 08 Jan 2007 17:36:56 +0100
parents 5d79c351e30a
children 7672a1041218
files dwm.h main.c view.c
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/dwm.h	Mon Jan 08 17:33:24 2007 +0100
     1.2 +++ b/dwm.h	Mon Jan 08 17:36:56 2007 +0100
     1.3 @@ -168,5 +168,6 @@
     1.4  extern void togglefloat(Arg *arg);		/* toggles focusesd client between floating/non-floating state */
     1.5  extern void togglemode(Arg *arg);		/* toggles global arrange function (dotile/dofloat) */
     1.6  extern void toggleview(Arg *arg);		/* toggles the tag with arg's index (in)visible */
     1.7 +extern void updatemodetext(void);		/* updates mtext */
     1.8  extern void view(Arg *arg);			/* views the tag with arg's index */
     1.9  extern void zoom(Arg *arg);			/* zooms the focused client to master area, arg is ignored */
     2.1 --- a/main.c	Mon Jan 08 17:33:24 2007 +0100
     2.2 +++ b/main.c	Mon Jan 08 17:36:56 2007 +0100
     2.3 @@ -133,8 +133,7 @@
     2.4  	sh = DisplayHeight(dpy, screen);
     2.5  	master = MASTER;
     2.6  	nmaster = NMASTER;
     2.7 -	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
     2.8 -	bmw = textw(mtext);
     2.9 +	updatemodetext();
    2.10  	/* bar */
    2.11  	bx = sx;
    2.12  	by = sy;
     3.1 --- a/view.c	Mon Jan 08 17:33:24 2007 +0100
     3.2 +++ b/view.c	Mon Jan 08 17:36:56 2007 +0100
     3.3 @@ -153,8 +153,7 @@
     3.4  	if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
     3.5  		return;
     3.6  	nmaster += arg->i;
     3.7 -	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
     3.8 -	bmw = textw(mtext);
     3.9 +	updatemodetext();
    3.10  	if(sel)
    3.11  		arrange();
    3.12  	else
    3.13 @@ -224,8 +223,7 @@
    3.14  void
    3.15  togglemode(Arg *arg) {
    3.16  	arrange = (arrange == dofloat) ? dotile : dofloat;
    3.17 -	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
    3.18 -	bmw = textw(mtext);
    3.19 +	updatemodetext();
    3.20  	if(sel)
    3.21  		arrange();
    3.22  	else
    3.23 @@ -244,6 +242,12 @@
    3.24  }
    3.25  
    3.26  void
    3.27 +updatemodetext() {
    3.28 +	snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
    3.29 +	bmw = textw(mtext);
    3.30 +}
    3.31 +
    3.32 +void
    3.33  view(Arg *arg) {
    3.34  	unsigned int i;
    3.35