aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-08 17:36:56 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-08 17:36:56 +0100
commit5a5851bac2670624f30c84efe4129f0101f62255 (patch)
tree41930b067cc1d4c42d928bc5dc58b9124d797c76
parent1d4a24dae02cfb3a3241c3d293e96dba910317bd (diff)
downloaddwm-5a5851bac2670624f30c84efe4129f0101f62255.tar
dwm-5a5851bac2670624f30c84efe4129f0101f62255.tar.gz
dwm-5a5851bac2670624f30c84efe4129f0101f62255.tar.bz2
reorganized
-rw-r--r--dwm.h1
-rw-r--r--main.c3
-rw-r--r--view.c12
3 files changed, 10 insertions, 6 deletions
diff --git a/dwm.h b/dwm.h
index 68b3e36..6a26e07 100644
--- a/dwm.h
+++ b/dwm.h
@@ -168,5 +168,6 @@ extern void restack(void); /* restores z layers of all clients */
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 --git a/main.c b/main.c
index c080ada..ba5e2e0 100644
--- a/main.c
+++ b/main.c
@@ -133,8 +133,7 @@ setup(void) {
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 --git a/view.c b/view.c
index 2f2d42a..06aed3e 100644
--- 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;