comparison view.c @ 473:2d8af0d7920d

implemented the maximization as I described on the mailinglist, this feels better to me.
author arg@mmvi
date Fri, 22 Sep 2006 07:37:56 +0200
parents e93b0ad5aeb5
children de69a7b0c8fa
comparison
equal deleted inserted replaced
472:298be2d65d2e 473:2d8af0d7920d
59 59
60 void 60 void
61 dofloat(Arg *arg) { 61 dofloat(Arg *arg) {
62 Client *c; 62 Client *c;
63 63
64 maximized = False;
65
66 for(c = clients; c; c = c->next) { 64 for(c = clients; c; c = c->next) {
67 if(isvisible(c)) { 65 if(isvisible(c)) {
68 resize(c, True, TopLeft); 66 resize(c, True, TopLeft);
69 } 67 }
70 else 68 else
79 77
80 void 78 void
81 dotile(Arg *arg) { 79 dotile(Arg *arg) {
82 int h, i, n, w; 80 int h, i, n, w;
83 Client *c; 81 Client *c;
84
85 maximized = False;
86 82
87 w = sw - mw; 83 w = sw - mw;
88 for(n = 0, c = clients; c; c = c->next) 84 for(n = 0, c = clients; c; c = c->next)
89 if(isvisible(c) && !c->isfloat) 85 if(isvisible(c) && !c->isfloat)
90 n++; 86 n++;
188 Client *c; 184 Client *c;
189 185
190 for(n = 0, c = clients; c; c = c->next) 186 for(n = 0, c = clients; c; c = c->next)
191 if(isvisible(c) && !c->isfloat) 187 if(isvisible(c) && !c->isfloat)
192 n++; 188 n++;
193 if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) 189 if(!sel || sel->isfloat || n < 2 || (arrange != dotile))
194 return; 190 return;
195 191
196 if(sel == getnext(clients)) { 192 if(sel == getnext(clients)) {
197 if(mw + arg->i > sw - 100 || mw + arg->i < 100) 193 if(mw + arg->i > sw - 100 || mw + arg->i < 100)
198 return; 194 return;
271 arrange(NULL); 267 arrange(NULL);
272 } 268 }
273 269
274 void 270 void
275 zoom(Arg *arg) { 271 zoom(Arg *arg) {
272 int tmp;
276 unsigned int n; 273 unsigned int n;
277 Client *c; 274 Client *c;
275 XEvent ev;
276
277 if(!sel)
278 return;
279
280 if(sel->isfloat || (arrange == dofloat)) {
281 tmp = sel->x; sel->x = sel->rx; sel->rx = tmp;
282 tmp = sel->y; sel->y = sel->ry; sel->ry = tmp;
283 tmp = sel->w; sel->w = sel->rw; sel->rw = tmp;
284 tmp = sel->h; sel->h = sel->rh; sel->rh = tmp;
285 resize(sel, True, TopLeft);
286 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
287 return;
288 }
278 289
279 for(n = 0, c = clients; c; c = c->next) 290 for(n = 0, c = clients; c; c = c->next)
280 if(isvisible(c) && !c->isfloat) 291 if(isvisible(c) && !c->isfloat)
281 n++; 292 n++;
282 if(!sel || sel->isfloat || n < 2 || (arrange != dotile) || maximized) 293 if(n < 2 || (arrange != dotile))
283 return; 294 return;
284 295
285 if((c = sel) == nexttiled(clients)) 296 if((c = sel) == nexttiled(clients))
286 if(!(c = nexttiled(c->next))) 297 if(!(c = nexttiled(c->next)))
287 return; 298 return;