Xinqi Bao's Git
1 /* See LICENSE file for copyright and license details. */
10 static unsigned int nlayouts
= 0;
20 if(lt
->arrange
!= floating
)
23 for(c
= clients
; c
; c
= c
->next
)
26 resize(c
, c
->x
, c
->y
, c
->w
, c
->h
, True
);
35 focusclient(const char *arg
) {
41 for(c
= sel
->prev
; c
&& !isvisible(c
); c
= c
->prev
);
43 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
44 for(; c
&& !isvisible(c
); c
= c
->prev
);
48 for(c
= sel
->next
; c
&& !isvisible(c
); c
= c
->next
);
50 for(c
= clients
; c
&& !isvisible(c
); c
= c
->next
);
63 nlayouts
= sizeof layout
/ sizeof layout
[0];
64 for(blw
= i
= 0; i
< nlayouts
; i
++) {
65 w
= textw(layout
[i
].symbol
);
72 nexttiled(Client
*c
) {
73 for(; c
&& (c
->isfloating
|| !isvisible(c
)); c
= c
->next
);
86 if(sel
->isfloating
|| lt
->arrange
== floating
)
87 XRaiseWindow(dpy
, sel
->win
);
88 if(lt
->arrange
!= floating
) {
89 wc
.stack_mode
= Below
;
91 if(!sel
->isfloating
) {
92 XConfigureWindow(dpy
, sel
->win
, CWSibling
| CWStackMode
, &wc
);
93 wc
.sibling
= sel
->win
;
95 for(c
= nexttiled(clients
); c
; c
= nexttiled(c
->next
)) {
98 XConfigureWindow(dpy
, c
->win
, CWSibling
| CWStackMode
, &wc
);
103 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
107 setlayout(const char *arg
) {
112 if(lt
== layout
+ nlayouts
)
117 if(i
< 0 || i
>= nlayouts
)
128 togglebar(const char *arg
) {
130 bpos
= (BARPOS
== BarOff
) ? BarTop
: BARPOS
;
138 togglemax(const char *arg
) {
141 if(!sel
|| (lt
->arrange
!= floating
&& !sel
->isfloating
) || sel
->isfixed
)
143 if((sel
->ismax
= !sel
->ismax
)) {
148 resize(sel
, wax
, way
, waw
- 2 * sel
->border
, wah
- 2 * sel
->border
, True
);
151 resize(sel
, sel
->rx
, sel
->ry
, sel
->rw
, sel
->rh
, True
);
153 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));