Xinqi Bao's Git
ac336e304ab25897c83b5dda2a922ded94f72e94
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
15 for(tic
= 0; tic
< ntags
&& !c
->tags
[tic
]; tic
++);
16 for(p
= clients
; p
; p
= p
->next
) {
17 for(i
= 0; i
< ntags
&& !p
->tags
[i
]; i
++);
28 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
34 void (*arrange
)(Arg
*) = DEFMODE
;
45 if(!(p
= getnext(clients
)) && !(p
= getslot(c
))) {
69 c
->prev
->next
= c
->next
;
71 c
->next
->prev
= c
->prev
;
74 c
->next
= c
->prev
= NULL
;
82 for(c
= clients
; c
; c
= c
->next
) {
85 resize(c
, True
, TopLeft
);
90 if(!sel
|| !isvisible(sel
))
91 sel
= getnext(clients
);
95 XSetInputFocus(dpy
, root
, RevertToPointerRoot
, CurrentTime
);
106 for(n
= 0, c
= clients
; c
; c
= c
->next
)
107 if(isvisible(c
) && !c
->isfloat
)
111 h
= (sh
- bh
) / (n
- 1);
115 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
119 resize(c
, True
, TopLeft
);
136 c
->y
= sy
+ (i
- 1) * h
+ bh
;
139 c
->h
= sh
- c
->y
- 2;
143 else { /* fallback if h < bh */
149 resize(c
, False
, TopLeft
);
155 if(!sel
|| !isvisible(sel
))
156 sel
= getnext(clients
);
160 XSetInputFocus(dpy
, root
, RevertToPointerRoot
, CurrentTime
);
172 if(!(c
= getnext(sel
->next
)))
173 c
= getnext(clients
);
188 if(!(c
= getprev(sel
->prev
))) {
189 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
203 for(i
= 0; i
< ntags
; i
++)
204 if(c
->tags
[i
] && seltag
[i
])
212 static unsigned int nwins
= 0;
213 static Window
*wins
= NULL
;
214 unsigned int f
, fi
, m
, mi
, n
;
218 for(f
= 0, m
= 0, c
= clients
; c
; c
= c
->next
)
220 if(c
->isfloat
|| arrange
== dofloat
)
225 if(!(n
= 2 * (f
+ m
))) {
231 wins
= erealloc(wins
, nwins
* sizeof(Window
));
236 if(sel
->isfloat
|| arrange
== dofloat
) {
237 wins
[fi
++] = sel
->twin
;
238 wins
[fi
++] = sel
->win
;
241 wins
[mi
++] = sel
->twin
;
242 wins
[mi
++] = sel
->win
;
244 for(c
= clients
; c
; c
= c
->next
)
245 if(isvisible(c
) && c
!= sel
) {
246 if(c
->isfloat
|| arrange
== dofloat
) {
247 wins
[fi
++] = c
->twin
;
251 wins
[mi
++] = c
->twin
;
255 XRestackWindows(dpy
, wins
, n
);
258 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
264 arrange
= (arrange
== dofloat
) ? dotile
: dofloat
;
276 seltag
[arg
->i
] = !seltag
[arg
->i
];
277 for(i
= 0; i
< ntags
&& !seltag
[i
]; i
++);
279 seltag
[arg
->i
] = True
; /* cannot toggle last view */
288 for(i
= 0; i
< ntags
; i
++)
290 seltag
[arg
->i
] = True
;
299 if(!c
|| (arrange
!= dotile
) || c
->isfloat
|| c
->ismax
)
302 if(c
== getnext(clients
))
303 if(!(c
= getnext(c
->next
)))