JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
simplified detach()
[dwm.git] / dwm.c
diff --git a/dwm.c b/dwm.c
index a13f07b..3d9a063 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -94,8 +94,6 @@ struct Client {
        Client *next;
        Client *snext;
        Window win;
-       void *aux;
-       void (*freeaux)(void *);
 };
 
 typedef struct {
@@ -461,16 +459,10 @@ destroynotify(XEvent *e) {
 
 void
 detach(Client *c) {
-       Client *i;
+       Client **tc;
 
-       if (c != clients) {
-               for(i = clients; i->next != c; i = i->next);
-               i->next = c->next;
-       }
-       else {
-               clients = c->next;
-       }
-       c->next =  NULL;
+       for(tc = &clients; *tc && *tc != c; tc = &(*tc)->next);
+       *tc = c->next;
 }
 
 void
@@ -1521,8 +1513,6 @@ unmanage(Client *c) {
        detachstack(c);
        if(sel == c)
                focus(NULL);
-       if(c->aux && c->freeaux)
-               c->freeaux(c->aux);
        XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
        setclientstate(c, WithdrawnState);
        free(c);