diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-05-29 11:35:20 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-05-29 11:35:20 +0200 |
| commit | 199a6016114875656102d11e79a80939bfaff3b3 (patch) | |
| tree | 2ad54798ecf25479959e50e611eb2163247745ec /layout.c | |
| parent | applied Sanders patch (diff) | |
| download | dwm-199a6016114875656102d11e79a80939bfaff3b3.tar.gz dwm-199a6016114875656102d11e79a80939bfaff3b3.zip | |
applied anydot's 3 minor patches, thank you anydot
Diffstat (limited to '')
| -rw-r--r-- | layout.c | 41 |
1 files changed, 24 insertions, 17 deletions
| @@ -14,6 +14,22 @@ static unsigned int masterw = MASTERWIDTH; | |||
| 14 | static unsigned int nmaster = NMASTER; | 14 | static unsigned int nmaster = NMASTER; |
| 15 | 15 | ||
| 16 | static void | 16 | static void |
| 17 | ban(Client *c) { | ||
| 18 | if (c->isbanned) | ||
| 19 | return; | ||
| 20 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 21 | c->isbanned = True; | ||
| 22 | } | ||
| 23 | |||
| 24 | static void | ||
| 25 | unban(Client *c) { | ||
| 26 | if (!c->isbanned) | ||
| 27 | return; | ||
| 28 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 29 | c->isbanned = False; | ||
| 30 | } | ||
| 31 | |||
| 32 | static void | ||
| 17 | tile(void) { | 33 | tile(void) { |
| 18 | unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; | 34 | unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; |
| 19 | Client *c; | 35 | Client *c; |
| @@ -28,9 +44,7 @@ tile(void) { | |||
| 28 | 44 | ||
| 29 | for(i = 0, c = clients; c; c = c->next) | 45 | for(i = 0, c = clients; c; c = c->next) |
| 30 | if(isvisible(c)) { | 46 | if(isvisible(c)) { |
| 31 | if(c->isbanned) | 47 | unban(c); |
| 32 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 33 | c->isbanned = False; | ||
| 34 | if(c->isfloating) | 48 | if(c->isfloating) |
| 35 | continue; | 49 | continue; |
| 36 | c->ismax = False; | 50 | c->ismax = False; |
| @@ -60,12 +74,9 @@ tile(void) { | |||
| 60 | resize(c, nx, ny, nw, nh, False); | 74 | resize(c, nx, ny, nw, nh, False); |
| 61 | i++; | 75 | i++; |
| 62 | } | 76 | } |
| 63 | else { | 77 | else |
| 64 | c->isbanned = True; | 78 | ban(c); |
| 65 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 79 | focus(NULL); |
| 66 | } | ||
| 67 | if(!sel || !isvisible(sel)) | ||
| 68 | focustopvisible(); | ||
| 69 | restack(); | 80 | restack(); |
| 70 | } | 81 | } |
| 71 | 82 | ||
| @@ -77,20 +88,16 @@ void | |||
| 77 | floating(void) { | 88 | floating(void) { |
| 78 | Client *c; | 89 | Client *c; |
| 79 | 90 | ||
| 80 | for(c = clients; c; c = c->next) { | 91 | for(c = clients; c; c = c->next) |
| 81 | if(isvisible(c)) { | 92 | if(isvisible(c)) { |
| 82 | if(c->isbanned) | 93 | if(c->isbanned) |
| 83 | XMoveWindow(dpy, c->win, c->x, c->y); | 94 | XMoveWindow(dpy, c->win, c->x, c->y); |
| 84 | c->isbanned = False; | 95 | c->isbanned = False; |
| 85 | resize(c, c->x, c->y, c->w, c->h, True); | 96 | resize(c, c->x, c->y, c->w, c->h, True); |
| 86 | } | 97 | } |
| 87 | else { | 98 | else |
| 88 | c->isbanned = True; | 99 | ban(c); |
| 89 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | 100 | focus(NULL); |
| 90 | } | ||
| 91 | } | ||
| 92 | if(!sel || !isvisible(sel)) | ||
| 93 | focustopvisible(); | ||
| 94 | restack(); | 101 | restack(); |
| 95 | } | 102 | } |
| 96 | 103 | ||
