JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
reorganized
[dwm.git] / view.c
diff --git a/view.c b/view.c
index 2f2d42a..06aed3e 100644 (file)
--- a/view.c
+++ b/view.c
@@ -153,8 +153,7 @@ incnmaster(Arg *arg) {
        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 @@ togglefloat(Arg *arg) {
 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 @@ toggleview(Arg *arg) {
 }
 
 void
+updatemodetext() {
+       snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
+       bmw = textw(mtext);
+}
+
+void
 view(Arg *arg) {
        unsigned int i;