Xinqi Bao's Git
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
;
62 for(c
= clients
; c
; c
= c
->next
) {
65 resize(c
, True
, TopLeft
);
70 if(!sel
|| !isvisible(sel
))
71 sel
= getnext(clients
);
75 XSetInputFocus(dpy
, root
, RevertToPointerRoot
, CurrentTime
);
86 for(n
= 0, c
= clients
; c
; c
= c
->next
)
87 if(isvisible(c
) && !c
->isfloat
)
91 h
= (sh
- bh
) / (n
- 1);
95 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
99 resize(c
, True
, TopLeft
);
116 c
->y
= sy
+ (i
- 1) * h
+ bh
;
119 c
->h
= sh
- c
->y
- 2;
123 else { /* fallback if h < bh */
129 resize(c
, False
, TopLeft
);
135 if(!sel
|| !isvisible(sel
))
136 sel
= getnext(clients
);
140 XSetInputFocus(dpy
, root
, RevertToPointerRoot
, CurrentTime
);
152 if(!(c
= getnext(sel
->next
)))
153 c
= getnext(clients
);
168 if(!(c
= getprev(sel
->prev
))) {
169 for(c
= clients
; c
&& c
->next
; c
= c
->next
);
183 for(i
= 0; i
< ntags
; i
++)
184 if(c
->tags
[i
] && seltag
[i
])
192 static unsigned int nwins
= 0;
193 static Window
*wins
= NULL
;
194 unsigned int f
, fi
, m
, mi
, n
;
198 for(f
= 0, m
= 0, c
= clients
; c
; c
= c
->next
)
200 if(c
->isfloat
|| arrange
== dofloat
)
205 if(!(n
= 2 * (f
+ m
))) {
211 wins
= erealloc(wins
, nwins
* sizeof(Window
));
216 if(sel
->isfloat
|| arrange
== dofloat
) {
217 wins
[fi
++] = sel
->twin
;
218 wins
[fi
++] = sel
->win
;
221 wins
[mi
++] = sel
->twin
;
222 wins
[mi
++] = sel
->win
;
224 for(c
= clients
; c
; c
= c
->next
)
225 if(isvisible(c
) && c
!= sel
) {
226 if(c
->isfloat
|| arrange
== dofloat
) {
227 wins
[fi
++] = c
->twin
;
231 wins
[mi
++] = c
->twin
;
235 XRestackWindows(dpy
, wins
, n
);
238 while(XCheckMaskEvent(dpy
, EnterWindowMask
, &ev
));
244 arrange
= (arrange
== dofloat
) ? dotile
: dofloat
;
256 seltag
[arg
->i
] = !seltag
[arg
->i
];
257 for(i
= 0; i
< ntags
&& !seltag
[i
]; i
++);
259 seltag
[arg
->i
] = True
; /* cannot toggle last view */
269 for(i
= 0; i
< ntags
; i
++)
271 seltag
[arg
->i
] = True
;
281 for(i
= 0; i
< ntags
; i
++)
292 if(!c
|| (arrange
!= dotile
) || c
->isfloat
|| c
->ismax
)
295 if(c
== getnext(clients
))
296 if(!(c
= getnext(c
->next
)))