diff options
Diffstat (limited to '')
| -rw-r--r-- | view.c | 18 |
1 files changed, 4 insertions, 14 deletions
| @@ -1,5 +1,4 @@ | |||
| 1 | /* | 1 | /* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> |
| 2 | * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | ||
| 3 | * See LICENSE file for license details. | 2 | * See LICENSE file for license details. |
| 4 | */ | 3 | */ |
| 5 | #include "dwm.h" | 4 | #include "dwm.h" |
| @@ -43,9 +42,9 @@ reorder(void) { | |||
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | static void | 44 | static void |
| 46 | togglemax(Client *c) | 45 | togglemax(Client *c) { |
| 47 | { | ||
| 48 | XEvent ev; | 46 | XEvent ev; |
| 47 | |||
| 49 | if((c->ismax = !c->ismax)) { | 48 | if((c->ismax = !c->ismax)) { |
| 50 | c->rx = c->x; c->x = sx; | 49 | c->rx = c->x; c->x = sx; |
| 51 | c->ry = c->y; c->y = bh; | 50 | c->ry = c->y; c->y = bh; |
| @@ -102,11 +101,9 @@ dotile(Arg *arg) { | |||
| 102 | 101 | ||
| 103 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) | 102 | for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) |
| 104 | n++; | 103 | n++; |
| 105 | |||
| 106 | mpx = (sw * master) / 1000; | 104 | mpx = (sw * master) / 1000; |
| 107 | stackw = sw - mpx; | 105 | stackw = sw - mpx; |
| 108 | stackh = sh - bh; | 106 | stackh = sh - bh; |
| 109 | |||
| 110 | th = stackh; | 107 | th = stackh; |
| 111 | if(n > 1) | 108 | if(n > 1) |
| 112 | th /= (n - 1); | 109 | th /= (n - 1); |
| @@ -145,6 +142,7 @@ dotile(Arg *arg) { | |||
| 145 | } | 142 | } |
| 146 | else | 143 | else |
| 147 | ban(c); | 144 | ban(c); |
| 145 | |||
| 148 | if(!sel || !isvisible(sel)) { | 146 | if(!sel || !isvisible(sel)) { |
| 149 | for(c = stack; c && !isvisible(c); c = c->snext); | 147 | for(c = stack; c && !isvisible(c); c = c->snext); |
| 150 | focus(c); | 148 | focus(c); |
| @@ -158,7 +156,6 @@ focusnext(Arg *arg) { | |||
| 158 | 156 | ||
| 159 | if(!sel) | 157 | if(!sel) |
| 160 | return; | 158 | return; |
| 161 | |||
| 162 | if(!(c = getnext(sel->next))) | 159 | if(!(c = getnext(sel->next))) |
| 163 | c = getnext(clients); | 160 | c = getnext(clients); |
| 164 | if(c) { | 161 | if(c) { |
| @@ -173,7 +170,6 @@ focusprev(Arg *arg) { | |||
| 173 | 170 | ||
| 174 | if(!sel) | 171 | if(!sel) |
| 175 | return; | 172 | return; |
| 176 | |||
| 177 | if(!(c = getprev(sel->prev))) { | 173 | if(!(c = getprev(sel->prev))) { |
| 178 | for(c = clients; c && c->next; c = c->next); | 174 | for(c = clients; c && c->next; c = c->next); |
| 179 | c = getprev(c); | 175 | c = getprev(c); |
| @@ -204,7 +200,6 @@ resizecol(Arg *arg) { | |||
| 204 | n++; | 200 | n++; |
| 205 | if(!sel || sel->isfloat || n < 2 || (arrange == dofloat)) | 201 | if(!sel || sel->isfloat || n < 2 || (arrange == dofloat)) |
| 206 | return; | 202 | return; |
| 207 | |||
| 208 | if(sel == getnext(clients)) { | 203 | if(sel == getnext(clients)) { |
| 209 | if(master + arg->i > 950 || master + arg->i < 50) | 204 | if(master + arg->i > 950 || master + arg->i < 50) |
| 210 | return; | 205 | return; |
| @@ -290,8 +285,6 @@ viewall(Arg *arg) { | |||
| 290 | arrange(NULL); | 285 | arrange(NULL); |
| 291 | } | 286 | } |
| 292 | 287 | ||
| 293 | |||
| 294 | |||
| 295 | void | 288 | void |
| 296 | zoom(Arg *arg) { | 289 | zoom(Arg *arg) { |
| 297 | unsigned int n; | 290 | unsigned int n; |
| @@ -299,18 +292,15 @@ zoom(Arg *arg) { | |||
| 299 | 292 | ||
| 300 | if(!sel) | 293 | if(!sel) |
| 301 | return; | 294 | return; |
| 302 | |||
| 303 | if(sel->isfloat || (arrange == dofloat)) { | 295 | if(sel->isfloat || (arrange == dofloat)) { |
| 304 | togglemax(sel); | 296 | togglemax(sel); |
| 305 | return; | 297 | return; |
| 306 | } | 298 | } |
| 307 | |||
| 308 | for(n = 0, c = clients; c; c = c->next) | 299 | for(n = 0, c = clients; c; c = c->next) |
| 309 | if(isvisible(c) && !c->isfloat) | 300 | if(isvisible(c) && !c->isfloat) |
| 310 | n++; | 301 | n++; |
| 311 | if(n < 2 || (arrange == dofloat)) | 302 | if(n < 2 || (arrange == dofloat)) |
| 312 | return; | 303 | return; |
| 313 | |||
| 314 | if((c = sel) == nexttiled(clients)) | 304 | if((c = sel) == nexttiled(clients)) |
| 315 | if(!(c = nexttiled(c->next))) | 305 | if(!(c = nexttiled(c->next))) |
| 316 | return; | 306 | return; |
