Mercurial > dwm-meillo
comparison view.c @ 400:052657ff2e7b
applied Sanders max_and_focus.patch
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Mon, 04 Sep 2006 08:55:49 +0200 |
parents | cb8a231610c7 |
children | 1eb2eb405653 |
comparison
equal
deleted
inserted
replaced
399:74739798b0b2 | 400:052657ff2e7b |
---|---|
55 } | 55 } |
56 | 56 |
57 void | 57 void |
58 dofloat(Arg *arg) | 58 dofloat(Arg *arg) |
59 { | 59 { |
60 Client *c; | 60 Client *c, *fc; |
61 | |
62 maximized = False; | |
61 | 63 |
62 for(c = clients; c; c = c->next) { | 64 for(c = clients; c; c = c->next) { |
63 c->ismax = False; | |
64 if(isvisible(c)) { | 65 if(isvisible(c)) { |
65 resize(c, True, TopLeft); | 66 resize(c, True, TopLeft); |
66 } | 67 } |
67 else | 68 else |
68 ban(c); | 69 ban(c); |
69 } | 70 } |
70 if(!sel || !isvisible(sel)) | 71 if(!(fc = sel) || !isvisible(fc)) |
71 sel = getnext(clients); | 72 fc = getnext(clients); |
72 if(sel) | 73 focus(fc); |
73 focus(sel); | |
74 else | |
75 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | |
76 restack(); | 74 restack(); |
77 } | 75 } |
78 | 76 |
79 void | 77 void |
80 dotile(Arg *arg) | 78 dotile(Arg *arg) |
81 { | 79 { |
82 int h, i, n, w; | 80 int h, i, n, w; |
83 Client *c; | 81 Client *c, *fc; |
82 | |
83 maximized = False; | |
84 | 84 |
85 w = sw - mw; | 85 w = sw - mw; |
86 for(n = 0, c = clients; c; c = c->next) | 86 for(n = 0, c = clients; c; c = c->next) |
87 if(isvisible(c) && !c->isfloat) | 87 if(isvisible(c) && !c->isfloat) |
88 n++; | 88 n++; |
91 h = (sh - bh) / (n - 1); | 91 h = (sh - bh) / (n - 1); |
92 else | 92 else |
93 h = sh - bh; | 93 h = sh - bh; |
94 | 94 |
95 for(i = 0, c = clients; c; c = c->next) { | 95 for(i = 0, c = clients; c; c = c->next) { |
96 c->ismax = False; | |
97 if(isvisible(c)) { | 96 if(isvisible(c)) { |
98 if(c->isfloat) { | 97 if(c->isfloat) { |
99 resize(c, True, TopLeft); | 98 resize(c, True, TopLeft); |
100 continue; | 99 continue; |
101 } | 100 } |
130 i++; | 129 i++; |
131 } | 130 } |
132 else | 131 else |
133 ban(c); | 132 ban(c); |
134 } | 133 } |
135 if(!sel || !isvisible(sel)) | 134 if(!(fc = sel) || !isvisible(fc)) |
136 sel = getnext(clients); | 135 fc = getnext(clients); |
137 if(sel) | 136 focus(fc); |
138 focus(sel); | |
139 else | |
140 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); | |
141 restack(); | 137 restack(); |
142 } | 138 } |
143 | 139 |
144 void | 140 void |
145 focusnext(Arg *arg) | 141 focusnext(Arg *arg) |
287 void | 283 void |
288 zoom(Arg *arg) | 284 zoom(Arg *arg) |
289 { | 285 { |
290 Client *c = sel; | 286 Client *c = sel; |
291 | 287 |
292 if(!c || (arrange != dotile) || c->isfloat || c->ismax) | 288 if(!c || (arrange != dotile) || c->isfloat || maximized) |
293 return; | 289 return; |
294 | 290 |
295 if(c == getnext(clients)) | 291 if(c == getnext(clients)) |
296 if(!(c = getnext(c->next))) | 292 if(!(c = getnext(c->next))) |
297 return; | 293 return; |