2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
9 void (*arrange)(Arg *) = DEFMODE;
16 for(c = clients; c; c = c->next) {
19 resize(c, True, TopLeft);
24 if(!sel || !isvisible(sel))
25 sel = getnext(clients);
29 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
40 for(n = 0, c = clients; c; c = c->next)
41 if(isvisible(c) && !c->isfloat)
45 h = (sh - bh) / (n - 1);
49 for(i = 0, c = clients; c; c = c->next) {
53 resize(c, True, TopLeft);
70 c->y = sy + (i - 1) * h + bh;
77 else { /* fallback if h < bh */
83 resize(c, False, TopLeft);
89 if(!sel || !isvisible(sel))
90 sel = getnext(clients);
94 XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
106 if(!(c = getnext(sel->next)))
107 c = getnext(clients);
122 if(!(c = getprev(sel->prev))) {
123 for(c = clients; c && c->next; c = c->next);
137 for(i = 0; i < ntags; i++)
138 if(c->tags[i] && seltag[i])
146 static unsigned int nwins = 0;
147 static Window *wins = NULL;
148 unsigned int f, fi, m, mi, n;
152 for(f = 0, m = 0, c = clients; c; c = c->next)
154 if(c->isfloat || arrange == dofloat)
159 if(!(n = 2 * (f + m))) {
165 wins = erealloc(wins, nwins * sizeof(Window));
170 if(sel->isfloat || arrange == dofloat) {
171 wins[fi++] = sel->title;
172 wins[fi++] = sel->win;
175 wins[mi++] = sel->title;
176 wins[mi++] = sel->win;
178 for(c = clients; c; c = c->next)
179 if(isvisible(c) && c != sel) {
180 if(c->isfloat || arrange == dofloat) {
181 wins[fi++] = c->title;
185 wins[mi++] = c->title;
189 XRestackWindows(dpy, wins, n);
192 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
198 arrange = (arrange == dofloat) ? dotile : dofloat;
210 seltag[arg->i] = !seltag[arg->i];
211 for(i = 0; i < ntags && !seltag[i]; i++);
213 seltag[arg->i] = True; /* cannot toggle last view */
222 for(i = 0; i < ntags; i++)
224 seltag[arg->i] = True;
233 if(!sel || (arrange != dotile) || sel->isfloat || sel->ismax)
236 if(sel == getnext(clients)) {
237 if((c = getnext(sel->next)))
244 sel->prev->next = sel->next;
246 sel->next->prev = sel->prev;