/* static */
-static void
-detachstack(Client *c) {
- Client **tc;
- for(tc=&stack; *tc && *tc != c; tc=&(*tc)->snext);
- *tc = c->snext;
-}
-
static void
grabbuttons(Client *c, Bool focused) {
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
/* extern */
-void
-ban(Client *c) {
- if(!c || c->isbanned)
- return;
- c->isbanned = True;
- XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
-}
-
void
configure(Client *c) {
XConfigureEvent ce;
}
if(c) {
detachstack(c);
- c->snext = stack;
- stack = c;
+ attachstack(c);
grabbuttons(c, True);
}
sel = c;
XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
}
-Client *
-getclient(Window w) {
- Client *c;
-
- for(c = clients; c; c = c->next)
- if(c->win == w)
- return c;
- return NULL;
-}
-
Bool
isprotodel(Client *c) {
int i, n;
settags(c, t);
if(!c->isfloat)
c->isfloat = (t != 0) || c->isfixed;
- if(clients)
- clients->prev = c;
- c->next = clients;
- c->snext = stack;
- stack = clients = c;
+ attach(c);
+ attachstack(c);
c->isbanned = True;
XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
XMapWindow(dpy, c->win);