Xinqi Bao's Git
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
15 if((clients
&& clients
->isfloat
) || arrange
== dofloat
)
16 return clients
; /* don't touch floating order */
17 for(min
= c
= clients
; c
; c
= c
->next
)
18 if(c
->weight
< min
->weight
)
26 Client
*c
, *newclients
, *tail
;
28 newclients
= tail
= NULL
;
29 while((c
= minclient())) {
37 tail
= newclients
= c
;
45 for(c
= getnext(c
); c
&& c
->isfloat
; c
= getnext(c
->next
));
51 void (*arrange
)(Arg
*) = DEFMODE
;
57 c
->prev
->next
= c
->next
;
59 c
->next
->prev
= c
->prev
;
62 c
->next
= c
->prev
= NULL
;
72 for(c
= clients
; c
; c
= c
->next
) {
74 resize(c
, True
, TopLeft
);
79 if(!sel
|| !isvisible(sel
)) {
80 for(sel
= stack
; sel
&& !isvisible(sel
); sel
= sel
->snext
);
95 for(n
= 0, c
= clients
; c
; c
= c
->next
)
96 if(isvisible(c
) && !c
->isfloat
)
100 h
= (sh
- bh
) / (n
- 1);
104 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
107 resize(c
, True
, TopLeft
);
124 c
->y
= sy
+ (i
- 1) * h
+ bh
;
127 c
->h
= sh
- c
->y
- 2;
131 else { /* fallback if h < bh */
137 resize(c
, False
, TopLeft
);
143 if(!sel
|| !isvisible(sel
)) {
144 for(sel
= stack
; sel
&& !isvisible(sel
); sel
= sel
->snext
);
158 if(!(c
= getnext(sel
->next
)))
159 c
= getnext(clients
);
174 if(!(c
= getprev(sel
->prev
))) {
175 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
189 for(i
= 0; i
< ntags
; i
++)
190 if(c
->tags
[i
] && seltag
[i
])
201 for(n
= 0, c
= clients
; c
; c
= c
->next
)
202 if(isvisible(c
) && !c
->isfloat
)
204 if(!sel
|| sel
->isfloat
|| n
< 2 || (arrange
!= dotile
) || maximized
)
207 if(sel
== getnext(clients
)) {
208 if(mw
+ arg
->i
> sw
- 100 || mw
+ arg
->i
< 100)
213 if(mw
- arg
->i
> sw
- 100 || mw
- arg
->i
< 100)
230 if(sel
->isfloat
|| arrange
== dofloat
) {
231 XRaiseWindow(dpy
, sel
->win
);
232 XRaiseWindow(dpy
, sel
->twin
);
234 if(arrange
!= dofloat
)
235 for(c
= nexttiled(clients
); c
; c
= nexttiled(c
->next
)) {
236 XLowerWindow(dpy
, c
->twin
);
237 XLowerWindow(dpy
, c
->win
);
241 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
247 arrange
= (arrange
== dofloat
) ? dotile
: dofloat
;
259 seltag
[arg
->i
] = !seltag
[arg
->i
];
260 for(i
= 0; i
< ntags
&& !seltag
[i
]; i
++);
262 seltag
[arg
->i
] = True
; /* cannot toggle last view */
272 for(i
= 0; i
< ntags
; i
++)
274 seltag
[arg
->i
] = True
;
284 for(i
= 0; i
< ntags
; i
++)
296 for(n
= 0, c
= clients
; c
; c
= c
->next
)
297 if(isvisible(c
) && !c
->isfloat
)
299 if(!sel
|| sel
->isfloat
|| n
< 2 || (arrange
!= dotile
) || maximized
)
302 if((c
= sel
) == nexttiled(clients
))
303 if(!(c
= nexttiled(c
->next
)))