X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=964544460c6b6eb4694dee0e021bdc24facb7832;hb=9d739090750ffb3b3a64e86e2331215b8901c360;hp=e8fe150f3ff63cce9d7564839dc304fdfc826b1e;hpb=0a25fe91888f30a382ca0cfb492283ce9aa3296c;p=dwm.git diff --git a/client.c b/client.c index e8fe150..9645444 100644 --- a/client.c +++ b/client.c @@ -52,8 +52,6 @@ grabbuttons(Client *c, Bool focus) static void resizetitle(Client *c) { - int i; - c->tw = textw(c->name); if(c->tw > c->w) c->tw = c->w + 2; @@ -232,13 +230,7 @@ manage(Window w, XWindowAttributes *wa) DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); - if(clients) - clients->prev = c; - c->next = clients; - clients = c; - grabbuttons(c, False); - if((tc = getclient(trans))) /* inherit tags */ for(i = 0; i < ntags; i++) c->tags[i] = tc->tags[i]; @@ -248,6 +240,12 @@ manage(Window w, XWindowAttributes *wa) c->isfloat = trans || (c->maxw && c->minw && c->maxw == c->minw && c->maxh == c->minh); + + if(clients) + clients->prev = c; + c->next = clients; + clients = c; + settitle(c); if(isvisible(c)) sel = c; @@ -340,7 +338,7 @@ void settitle(Client *c) { char **list = NULL; - int i, n; + int n; XTextProperty name; name.nitems = 0; @@ -409,12 +407,7 @@ unmanage(Client *c) XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->twin); - if(c->prev) - c->prev->next = c->next; - if(c->next) - c->next->prev = c->prev; - if(c == clients) - clients = c->next; + detach(c); if(sel == c) { if(trans && (tc = getclient(trans)) && isvisible(tc)) sel = tc;