diff options
| -rw-r--r-- | dwm.h | 1 | ||||
| -rw-r--r-- | main.c | 3 | ||||
| -rw-r--r-- | view.c | 12 |
3 files changed, 10 insertions, 6 deletions
| @@ -168,5 +168,6 @@ extern void restack(void); /* restores z layers of all clients */ | |||
| 168 | extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ | 168 | extern void togglefloat(Arg *arg); /* toggles focusesd client between floating/non-floating state */ |
| 169 | extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ | 169 | extern void togglemode(Arg *arg); /* toggles global arrange function (dotile/dofloat) */ |
| 170 | extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ | 170 | extern void toggleview(Arg *arg); /* toggles the tag with arg's index (in)visible */ |
| 171 | extern void updatemodetext(void); /* updates mtext */ | ||
| 171 | extern void view(Arg *arg); /* views the tag with arg's index */ | 172 | extern void view(Arg *arg); /* views the tag with arg's index */ |
| 172 | extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */ | 173 | extern void zoom(Arg *arg); /* zooms the focused client to master area, arg is ignored */ |
| @@ -133,8 +133,7 @@ setup(void) { | |||
| 133 | sh = DisplayHeight(dpy, screen); | 133 | sh = DisplayHeight(dpy, screen); |
| 134 | master = MASTER; | 134 | master = MASTER; |
| 135 | nmaster = NMASTER; | 135 | nmaster = NMASTER; |
| 136 | snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); | 136 | updatemodetext(); |
| 137 | bmw = textw(mtext); | ||
| 138 | /* bar */ | 137 | /* bar */ |
| 139 | bx = sx; | 138 | bx = sx; |
| 140 | by = sy; | 139 | by = sy; |
| @@ -153,8 +153,7 @@ incnmaster(Arg *arg) { | |||
| 153 | if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) | 153 | if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) |
| 154 | return; | 154 | return; |
| 155 | nmaster += arg->i; | 155 | nmaster += arg->i; |
| 156 | snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); | 156 | updatemodetext(); |
| 157 | bmw = textw(mtext); | ||
| 158 | if(sel) | 157 | if(sel) |
| 159 | arrange(); | 158 | arrange(); |
| 160 | else | 159 | else |
| @@ -224,8 +223,7 @@ togglefloat(Arg *arg) { | |||
| 224 | void | 223 | void |
| 225 | togglemode(Arg *arg) { | 224 | togglemode(Arg *arg) { |
| 226 | arrange = (arrange == dofloat) ? dotile : dofloat; | 225 | arrange = (arrange == dofloat) ? dotile : dofloat; |
| 227 | snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); | 226 | updatemodetext(); |
| 228 | bmw = textw(mtext); | ||
| 229 | if(sel) | 227 | if(sel) |
| 230 | arrange(); | 228 | arrange(); |
| 231 | else | 229 | else |
| @@ -244,6 +242,12 @@ toggleview(Arg *arg) { | |||
| 244 | } | 242 | } |
| 245 | 243 | ||
| 246 | void | 244 | void |
| 245 | updatemodetext() { | ||
| 246 | snprintf(mtext, sizeof mtext, arrange == dofloat ? FLOATSYMBOL : TILESYMBOL, nmaster); | ||
| 247 | bmw = textw(mtext); | ||
| 248 | } | ||
| 249 | |||
| 250 | void | ||
| 247 | view(Arg *arg) { | 251 | view(Arg *arg) { |
| 248 | unsigned int i; | 252 | unsigned int i; |
| 249 | 253 | ||
