-void
-floating(Arg *arg)
-{
- Client *c;
-
- arrange = floating;
- for(c = clients; c; c = c->next) {
- if(c->tags[tsel])
- resize(c, True);
- else
- ban_client(c);
- }
- if(sel && !sel->tags[tsel]) {
- if((sel = next(clients))) {
- craise(sel);
- focus(sel);
- }
- }
- discard_events(EnterWindowMask);
-}
-
-void
-tiling(Arg *arg)
-{
- Client *c;
- int n, i, w, h;
-
- w = sw - mw;
- arrange = tiling;
- for(n = 0, c = clients; c; c = c->next)
- if(c->tags[tsel] && !c->floating)
- n++;
-
- h = (n > 1) ? sh / (n - 1) : sh;
-
- for(i = 0, c = clients; c; c = c->next) {
- if(c->tags[tsel]) {
- if(c->floating) {
- craise(c);
- resize(c, True);
- continue;
- }
- if(n == 1) {
- c->x = sx;
- c->y = sy;
- c->w = sw - 2 * c->border;
- c->h = sh - 2 * c->border;
- }
- else if(i == 0) {
- c->x = sx;
- c->y = sy;
- c->w = mw - 2 * c->border;
- c->h = sh - 2 * c->border;
- }
- else {
- c->x = sx + mw;
- c->y = sy + (i - 1) * h;
- c->w = w - 2 * c->border;
- c->h = h - 2 * c->border;
- }
- resize(c, False);
- i++;
- }
- else
- ban_client(c);
- }
- if(sel && !sel->tags[tsel]) {
- if((sel = next(clients))) {
- craise(sel);
- focus(sel);
- }
- }
- discard_events(EnterWindowMask);
-}
-
-void
-prevc(Arg *arg)
-{
- Client *c;
-
- if(!sel)
- return;
-
- if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) {
- craise(c);
- focus(c);
- }
-}
-
-void
-nextc(Arg *arg)
-{
- Client *c;
-
- if(!sel)
- return;
-
- if(!(c = next(sel->next)))
- c = next(clients);
- if(c) {
- craise(c);
- c->revert = sel;
- focus(c);
- }
-}
-
-void
-ckill(Arg *arg)
-{
- if(!sel)
- return;
- if(sel->proto & WM_PROTOCOL_DELWIN)
- send_message(sel->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
- else
- XKillClient(dpy, sel->win);
-}
-