Xinqi Bao's Git
21efa164f0a1c818a5d672de1a6e6153444549b7
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
15 for(min
= c
= clients
; c
; c
= c
->next
)
16 if(c
->weight
< min
->weight
)
25 Client
*c
, *newclients
, *tail
;
27 newclients
= tail
= NULL
;
28 while((c
= minclient())) {
36 tail
= newclients
= c
;
43 void (*arrange
)(Arg
*) = DEFMODE
;
49 c
->prev
->next
= c
->next
;
51 c
->next
->prev
= c
->prev
;
54 c
->next
= c
->prev
= NULL
;
64 for(c
= clients
; c
; c
= c
->next
) {
66 resize(c
, True
, TopLeft
);
71 if(!sel
|| !isvisible(sel
))
72 focus(getnext(clients
));
85 for(n
= 0, c
= clients
; c
; c
= c
->next
)
86 if(isvisible(c
) && !c
->isfloat
)
90 h
= (sh
- bh
) / (n
- 1);
94 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
97 resize(c
, True
, TopLeft
);
114 c
->y
= sy
+ (i
- 1) * h
+ bh
;
117 c
->h
= sh
- c
->y
- 2;
121 else { /* fallback if h < bh */
127 resize(c
, False
, TopLeft
);
133 if(!sel
|| !isvisible(sel
))
134 focus(getnext(clients
));
146 if(!(c
= getnext(sel
->next
)))
147 c
= getnext(clients
);
162 if(!(c
= getprev(sel
->prev
))) {
163 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
177 for(i
= 0; i
< ntags
; i
++)
178 if(c
->tags
[i
] && seltag
[i
])
186 static unsigned int nwins
= 0;
187 static Window
*wins
= NULL
;
188 unsigned int f
, fi
, m
, mi
, n
;
192 for(f
= 0, m
= 0, c
= clients
; c
; c
= c
->next
)
194 if(c
->isfloat
|| arrange
== dofloat
)
199 if(!(n
= 2 * (f
+ m
))) {
205 wins
= erealloc(wins
, nwins
* sizeof(Window
));
210 if(sel
->isfloat
|| arrange
== dofloat
) {
211 wins
[fi
++] = sel
->twin
;
212 wins
[fi
++] = sel
->win
;
215 wins
[mi
++] = sel
->twin
;
216 wins
[mi
++] = sel
->win
;
218 for(c
= clients
; c
; c
= c
->next
)
219 if(isvisible(c
) && c
!= sel
) {
220 if(c
->isfloat
|| arrange
== dofloat
) {
221 wins
[fi
++] = c
->twin
;
225 wins
[mi
++] = c
->twin
;
229 XRestackWindows(dpy
, wins
, n
);
232 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
238 arrange
= (arrange
== dofloat
) ? dotile
: dofloat
;
250 seltag
[arg
->i
] = !seltag
[arg
->i
];
251 for(i
= 0; i
< ntags
&& !seltag
[i
]; i
++);
253 seltag
[arg
->i
] = True
; /* cannot toggle last view */
263 for(i
= 0; i
< ntags
; i
++)
265 seltag
[arg
->i
] = True
;
275 for(i
= 0; i
< ntags
; i
++)
286 if(!c
|| (arrange
!= dotile
) || c
->isfloat
|| maximized
)
289 if(c
== getnext(clients
))
290 if(!(c
= getnext(c
->next
)))