diff options
| author | arg@mmvi <unknown> | 2006-09-22 13:53:28 +0200 |
|---|---|---|
| committer | arg@mmvi <unknown> | 2006-09-22 13:53:28 +0200 |
| commit | 346bdea946887d83f857a8944a0189bca51a3e47 (patch) | |
| tree | 2e8a502e745df40c6042ea4e58dc5872c950a8f8 | |
| parent | fixed issue pointed out by Jukka (diff) | |
| download | dwm-346bdea946887d83f857a8944a0189bca51a3e47.tar.gz dwm-346bdea946887d83f857a8944a0189bca51a3e47.zip | |
small change to achieve Jukka's last proposal
| -rw-r--r-- | dwm.h | 3 | ||||
| -rw-r--r-- | view.c | 45 |
2 files changed, 34 insertions, 14 deletions
| @@ -77,12 +77,13 @@ struct Client { | |||
| 77 | char name[256]; | 77 | char name[256]; |
| 78 | int proto; | 78 | int proto; |
| 79 | int x, y, w, h; | 79 | int x, y, w, h; |
| 80 | int rx, ry, rw, rh; /* revert geometry */ | ||
| 80 | int tx, ty, tw, th; /* title window geometry */ | 81 | int tx, ty, tw, th; /* title window geometry */ |
| 81 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; | 82 | int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
| 82 | int grav; | 83 | int grav; |
| 83 | long flags; | 84 | long flags; |
| 84 | unsigned int border, weight; | 85 | unsigned int border, weight; |
| 85 | Bool isfloat; | 86 | Bool isfloat, ismax; |
| 86 | Bool *tags; | 87 | Bool *tags; |
| 87 | Client *next; | 88 | Client *next; |
| 88 | Client *prev; | 89 | Client *prev; |
| @@ -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 | ||
