comparison aewl.c @ 768:a1c6805aa018

simplified and corrected domax() and restack()
author meillo@marmaro.de
date Fri, 05 Dec 2008 21:14:50 +0100
parents 706991d15451
children 49aa8ccceefa
comparison
equal deleted inserted replaced
767:706991d15451 768:a1c6805aa018
312 restack(); 312 restack();
313 } 313 }
314 314
315 /* begin code by mitch */ 315 /* begin code by mitch */
316 void 316 void
317 arrangemax(Client *c) {
318 if(c == sel) {
319 c->ismax = True;
320 c->x = sx;
321 c->y = bh;
322 c->w = sw - 2 * BORDERPX;
323 c->h = sh - bh - 2 * BORDERPX;
324 XRaiseWindow(dpy, c->win);
325 } else {
326 c->ismax = False;
327 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
328 XLowerWindow(dpy, c->win);
329 }
330 }
331
332 void
333 domax(void) { 317 domax(void) {
334 Client *c; 318 Client *c;
335 319
336 for(c = clients; c; c = c->next) { 320 for(c = clients; c; c = c->next) {
337 if(isvisible(c)) { 321 if(isvisible(c)) {
338 if(c->isfloat) { 322 if(c->isfloat) {
339 resize(c, True); 323 resize(c, True);
340 continue; 324 continue;
341 } 325 }
342 arrangemax(c); 326 c->ismax = True;
327 c->x = sx;
328 c->y = bh;
329 c->w = sw - 2 * BORDERPX;
330 c->h = sh - bh - 2 * BORDERPX;
343 resize(c, False); 331 resize(c, False);
344 } else { 332 } else {
345 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); 333 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
346 } 334 }
347
348 } 335 }
349 if(!sel || !isvisible(sel)) { 336 if(!sel || !isvisible(sel)) {
350 for(c = stack; c && !isvisible(c); c = c->snext); 337 for(c = stack; c && !isvisible(c); c = c->snext);
351 focus(c); 338 focus(c);
352 } 339 }
404 if(!sel) 391 if(!sel)
405 return; 392 return;
406 if(sel->isfloat) 393 if(sel->isfloat)
407 XRaiseWindow(dpy, sel->win); 394 XRaiseWindow(dpy, sel->win);
408 395
409 /* begin code by mitch */ 396 if(!sel->isfloat)
410 if(arrange == domax) { 397 XLowerWindow(dpy, sel->win);
411 for(c = nexttiled(clients); c; c = nexttiled(c->next)) { 398 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
412 arrangemax(c); 399 if(c == sel)
413 resize(c, False); 400 continue;
414 } 401 XLowerWindow(dpy, c->win);
415 402 }
416 } else if (arrange == dotile) { 403
417 /* end code by mitch */
418
419 if(!sel->isfloat)
420 XLowerWindow(dpy, sel->win);
421 for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
422 if(c == sel)
423 continue;
424 XLowerWindow(dpy, c->win);
425 }
426 }
427 XSync(dpy, False); 404 XSync(dpy, False);
428 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); 405 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
429 } 406 }
430 407
431 void 408 void
555 532
556 /* static */ 533 /* static */
557 534
558 Client * 535 Client *
559 getnext(Client *c) { 536 getnext(Client *c) {
560 for(; c && !isvisible(c); c = c->next); 537 while(c && !isvisible(c)) {
538 c = c->next;
539 }
561 return c; 540 return c;
562 } 541 }
563 542
564 void 543 void
565 settag(Client *c, Client *trans) { 544 settag(Client *c, Client *trans) {