summaryrefslogtreecommitdiffstats
path: root/view.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-08 17:33:24 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-08 17:33:24 +0100
commit1d4a24dae02cfb3a3241c3d293e96dba910317bd (patch)
tree52267e4a8de9e198fed15726c20734e7ac735197 /view.c
parentAdded tag 2.9 for changeset 3a5910fac3cc (diff)
downloaddwm-1d4a24dae02cfb3a3241c3d293e96dba910317bd.tar.gz
dwm-1d4a24dae02cfb3a3241c3d293e96dba910317bd.zip
implemented nmaster appearance in mode label (using %u)
Diffstat (limited to 'view.c')
-rw-r--r--view.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/view.c b/view.c
index f2e4040..2f2d42a 100644
--- a/view.c
+++ b/view.c
@@ -2,6 +2,7 @@
2 * See LICENSE file for license details. 2 * See LICENSE file for license details.
3 */ 3 */
4#include "dwm.h" 4#include "dwm.h"
5#include <stdio.h>
5 6
6/* static */ 7/* static */
7 8
@@ -149,10 +150,15 @@ focusprev(Arg *arg) {
149 150
150void 151void
151incnmaster(Arg *arg) { 152incnmaster(Arg *arg) {
152 if((nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) 153 if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh))
153 return; 154 return;
154 nmaster += arg->i; 155 nmaster += arg->i;
155 arrange(); 156 snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
157 bmw = textw(mtext);
158 if(sel)
159 arrange();
160 else
161 drawstatus();
156} 162}
157 163
158Bool 164Bool
@@ -218,6 +224,8 @@ togglefloat(Arg *arg) {
218void 224void
219togglemode(Arg *arg) { 225togglemode(Arg *arg) {
220 arrange = (arrange == dofloat) ? dotile : dofloat; 226 arrange = (arrange == dofloat) ? dotile : dofloat;
227 snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster);
228 bmw = textw(mtext);
221 if(sel) 229 if(sel)
222 arrange(); 230 arrange();
223 else 231 else