summaryrefslogtreecommitdiffstats
path: root/view.c
diff options
context:
space:
mode:
authorarg@mmvi <unknown>2006-09-22 13:53:28 +0200
committerarg@mmvi <unknown>2006-09-22 13:53:28 +0200
commit346bdea946887d83f857a8944a0189bca51a3e47 (patch)
tree2e8a502e745df40c6042ea4e58dc5872c950a8f8 /view.c
parentfixed issue pointed out by Jukka (diff)
downloaddwm-346bdea946887d83f857a8944a0189bca51a3e47.tar.gz
dwm-346bdea946887d83f857a8944a0189bca51a3e47.zip
small change to achieve Jukka's last proposal
Diffstat (limited to '')
-rw-r--r--view.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/view.c b/view.c
index bb32235..5667134 100644
--- a/view.c
+++ b/view.c
@@ -18,6 +18,12 @@ minclient() {
18 return min; 18 return min;
19} 19}
20 20
21static Client *
22nexttiled(Client *c) {
23 for(c = getnext(c); c && c->isfloat; c = getnext(c->next));
24 return c;
25}
26
21static void 27static void
22reorder() { 28reorder() {
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
39static Client * 45static void
40nexttiled(Client *c) { 46togglemax(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
270void 295void
271zoom(Arg *arg) { 296zoom(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