static void
resizetitle(Client *c)
{
- int i;
-
c->tw = textw(c->name);
if(c->tw > c->w)
c->tw = c->w + 2;
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];
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;
settitle(Client *c)
{
char **list = NULL;
- int i, n;
+ int n;
XTextProperty name;
name.nitems = 0;
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;