diff options
Diffstat (limited to '')
| -rw-r--r-- | view.c | 45 |
1 files changed, 32 insertions, 13 deletions
| @@ -18,6 +18,12 @@ minclient() { | |||
| 18 | return min; | 18 | return min; |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | static Client * | ||
| 22 | nexttiled(Client *c) { | ||
| 23 | for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); | ||
| 24 | return c; | ||
| 25 | } | ||
| 26 | |||
| 21 | static void | 27 | static void |
| 22 | reorder() { | 28 | reorder() { |
| 23 | Client *c, *newclients, *tail; | 29 | Client *c, *newclients, *tail; |
| @@ -36,10 +42,23 @@ reorder() { | |||
| 36 | clients = newclients; | 42 | clients = newclients; |
| 37 | } | 43 | } |
| 38 | 44 | ||
| 39 | static Client * | 45 | static void |
| 40 | nexttiled(Client *c) { | 46 | togglemax(Client *c) |
| 41 | for(c = getnext(c); c && c->isfloat; c = getnext(c->next)); | 47 | { |
| 42 | return c; | 48 | if((c->ismax = !c->ismax)) { |
| 49 | c->rx = c->x; c->x = sx; | ||
| 50 | c->ry = c->y; c->y = bh; | ||
| 51 | c->rw = c->w; c->w = sw; | ||
| 52 | c->rh = c->h; c->h = sh; | ||
| 53 | } | ||
| 54 | else { | ||
| 55 | c->x = c->rx; | ||
| 56 | c->y = c->ry; | ||
| 57 | c->w = c->w; | ||
| 58 | c->h = c->h; | ||
| 59 | } | ||
| 60 | resize(c, True, TopLeft); | ||
| 61 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 43 | } | 62 | } |
| 44 | 63 | ||
| 45 | /* extern */ | 64 | /* extern */ |
| @@ -82,8 +101,14 @@ dotile(Arg *arg) { | |||
| 82 | 101 | ||
| 83 | w = sw - mw; | 102 | w = sw - mw; |
| 84 | for(n = 0, c = clients; c; c = c->next) | 103 | for(n = 0, c = clients; c; c = c->next) |
| 85 | if(isvisible(c) && !c->isfloat) | 104 | if(isvisible(c)) { |
| 86 | n++; | 105 | if(c->isfloat) { |
| 106 | if(c->ismax) | ||
| 107 | togglemax(c); | ||
| 108 | } | ||
| 109 | else | ||
| 110 | n++; | ||
| 111 | } | ||
| 87 | 112 | ||
| 88 | if(n > 1) | 113 | if(n > 1) |
| 89 | h = (sh - bh) / (n - 1); | 114 | h = (sh - bh) / (n - 1); |
| @@ -269,7 +294,6 @@ viewall(Arg *arg) { | |||
| 269 | 294 | ||
| 270 | void | 295 | void |
| 271 | zoom(Arg *arg) { | 296 | zoom(Arg *arg) { |
| 272 | int tmp; | ||
| 273 | unsigned int n; | 297 | unsigned int n; |
| 274 | Client *c; | 298 | Client *c; |
| 275 | XEvent ev; | 299 | XEvent ev; |
| @@ -278,12 +302,7 @@ zoom(Arg *arg) { | |||
| 278 | return; | 302 | return; |
| 279 | 303 | ||
| 280 | if(sel->isfloat || (arrange == dofloat)) { | 304 | if(sel->isfloat || (arrange == dofloat)) { |
| 281 | sel->x = sx; | 305 | togglemax(sel); |
| 282 | sel->y = bh; | ||
| 283 | sel->w = sw; | ||
| 284 | sel->h = sh - bh; | ||
| 285 | resize(sel, True, TopLeft); | ||
| 286 | while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); | ||
| 287 | return; | 306 | return; |
| 288 | } | 307 | } |
| 289 | 308 | ||
