- Client *c;
-
- arrange = floating;
- if(!csel)
- return;
- for(c = csel; c; c = next(c))
- resize(c);
- discard_events(EnterWindowMask);
-}
-
-void
-tiling(Arg *arg)
-{
- Client *c;
- int n, cols, rows, gw, gh, i, j;
- float rt, fd;
-
- arrange = tiling;
- if(!csel)
- return;
- for(n = 0, c = csel; c; c = next(c), n++);
- rt = sqrt(n);
- if(modff(rt, &fd) < 0.5)
- rows = floor(rt);
- else
- rows = ceil(rt);
- if(rows * rows < n)
- cols = rows + 1;
- else
- cols = rows;
-
- gw = (sw - 2) / cols;
- gh = (sh - 2) / rows;
-
- for(i = j = 0, c = csel; c; c = next(c)) {
- c->x = i * gw;
- c->y = j * gh;
- c->w = gw;
- c->h = gh;
- resize(c);
- if(++i == cols) {
- j++;
- i = 0;
- }
- }
- discard_events(EnterWindowMask);
-}
-
-void
-prevc(Arg *arg)
-{
- Client *c;
-
- if(!csel)
- return;
-
- if(!(c = prev(csel)))
- c = prev(cend);
- if(c) {
- craise(c);
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
- focus(c);
- }
-}
-
-void
-nextc(Arg *arg)
-{
- Client *c;
-
- if(!csel)
- return;
-
- if(!(c = next(csel)))
- c = next(cstart);
-
- if(c) {
- craise(c);
- XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
- focus(c);
- }
-}
-
-void
-ckill(Arg *arg)
-{
- Client *c = csel;
-
- if(!c)
- return;
- if(c->proto & WM_PROTOCOL_DELWIN)
- send_message(c->win, wm_atom[WMProtocols], wm_atom[WMDelete]);
- else
- XKillClient(dpy, c->win);
+ XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
+ XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty);