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 focus(getnext(clients
));
93 for(n
= 0, c
= clients
; c
; c
= c
->next
)
94 if(isvisible(c
) && !c
->isfloat
)
98 h
= (sh
- bh
) / (n
- 1);
102 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
105 resize(c
, True
, TopLeft
);
122 c
->y
= sy
+ (i
- 1) * h
+ bh
;
125 c
->h
= sh
- c
->y
- 2;
129 else { /* fallback if h < bh */
135 resize(c
, False
, TopLeft
);
141 if(!sel
|| !isvisible(sel
))
142 focus(getnext(clients
));
154 if(!(c
= getnext(sel
->next
)))
155 c
= getnext(clients
);
170 if(!(c
= getprev(sel
->prev
))) {
171 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
185 for(i
= 0; i
< ntags
; i
++)
186 if(c
->tags
[i
] && seltag
[i
])
197 for(n
= 0, c
= clients
; c
; c
= c
->next
)
198 if(isvisible(c
) && !c
->isfloat
)
200 if(!sel
|| sel
->isfloat
|| n
< 2 || (arrange
!= dotile
) || maximized
)
203 if(sel
== getnext(clients
)) {
204 if(mw
+ arg
->i
> sw
- 100 || mw
+ arg
->i
< 100)
209 if(mw
- arg
->i
> sw
- 100 || mw
- arg
->i
< 100)
226 if(sel
->isfloat
|| arrange
== dofloat
) {
227 XRaiseWindow(dpy
, sel
->win
);
228 XRaiseWindow(dpy
, sel
->twin
);
230 if(arrange
!= dofloat
)
231 for(c
= nexttiled(clients
); c
; c
= nexttiled(c
->next
)) {
232 XLowerWindow(dpy
, c
->twin
);
233 XLowerWindow(dpy
, c
->win
);
237 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
243 arrange
= (arrange
== dofloat
) ? dotile
: dofloat
;
255 seltag
[arg
->i
] = !seltag
[arg
->i
];
256 for(i
= 0; i
< ntags
&& !seltag
[i
]; i
++);
258 seltag
[arg
->i
] = True
; /* cannot toggle last view */
268 for(i
= 0; i
< ntags
; i
++)
270 seltag
[arg
->i
] = True
;
280 for(i
= 0; i
< ntags
; i
++)
292 for(n
= 0, c
= clients
; c
; c
= c
->next
)
293 if(isvisible(c
) && !c
->isfloat
)
295 if(!sel
|| sel
->isfloat
|| n
< 2 || (arrange
!= dotile
) || maximized
)
298 if((c
= sel
) == nexttiled(clients
))
299 if(!(c
= nexttiled(c
->next
)))