-void
-zoom(Arg *arg) {
- int tmp;
- unsigned int n;
- Client *c;
- XEvent ev;
-
- if(!sel)
- return;
-
- if(sel->isfloat || (arrange == dofloat)) {
- sel->x = sx;
- sel->y = bh;
- sel->w = sw;
- sel->h = sh - bh;
- resize(sel, True, TopLeft);
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
- return;
- }
-
- for(n = 0, c = clients; c; c = c->next)
- if(isvisible(c) && !c->isfloat)
- n++;
- if(n < 2 || (arrange != dotile))
- return;
-
- if((c = sel) == nexttiled(clients))
- if(!(c = nexttiled(c->next)))
- return;
- detach(c);
- if(clients)
- clients->prev = c;
- c->next = clients;
- clients = c;
- focus(c);
- arrange(NULL);
-}