X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=e7a386401714203a5a49d28004361d6356f893c0;hb=b3d7e07f18f0f69f8c3b3542615da62dfc4c6175;hp=bc26997ff754fa86abee6bd8cff1b95fd0b6e1de;hpb=6e22ccf7b1602b33624692eefd51b6398ffa5454;p=dwm.git diff --git a/client.c b/client.c index bc26997..e7a3864 100644 --- a/client.c +++ b/client.c @@ -10,13 +10,6 @@ /* 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); @@ -68,14 +61,6 @@ xerrordummy(Display *dsply, XErrorEvent *ee) { /* 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; @@ -103,8 +88,7 @@ focus(Client *c) { } if(c) { detachstack(c); - c->snext = stack; - stack = c; + attachstack(c); grabbuttons(c, True); } sel = c; @@ -119,16 +103,6 @@ focus(Client *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; @@ -197,11 +171,8 @@ manage(Window w, XWindowAttributes *wa) { 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);