# HG changeset patch # User Anselm R. Garbe # Date 1168274216 -3600 # Node ID 1438e35b622e9b7e38d55337c53b20cb894a78b4 # Parent 5d79c351e30ae49c4c4b6deffee5162ed6714841 reorganized diff -r 5d79c351e30a -r 1438e35b622e dwm.h --- a/dwm.h Mon Jan 08 17:33:24 2007 +0100 +++ b/dwm.h Mon Jan 08 17:36:56 2007 +0100 @@ -168,5 +168,6 @@ extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ +extern void updatemodetext(void); /* updates mtext */ extern void view(Arg *arg); /* views the tag with arg's index */ extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */ diff -r 5d79c351e30a -r 1438e35b622e main.c --- a/main.c Mon Jan 08 17:33:24 2007 +0100 +++ b/main.c Mon Jan 08 17:36:56 2007 +0100 @@ -133,8 +133,7 @@ sh = DisplayHeight(dpy, screen); master = MASTER; nmaster = NMASTER; - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); + updatemodetext(); /* bar */ bx = sx; by = sy; diff -r 5d79c351e30a -r 1438e35b622e view.c --- a/view.c Mon Jan 08 17:33:24 2007 +0100 +++ b/view.c Mon Jan 08 17:36:56 2007 +0100 @@ -153,8 +153,7 @@ if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) return; nmaster += arg->i; - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); + updatemodetext(); if(sel) arrange(); else @@ -224,8 +223,7 @@ void togglemode(Arg *arg) { arrange = (arrange == dofloat) ? dotile : dofloat; - snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); - bmw = textw(mtext); + updatemodetext(); if(sel) arrange(); else @@ -244,6 +242,12 @@ } void +updatemodetext() { + snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); + bmw = textw(mtext); +} + +void view(Arg *arg) { unsigned int i;