mirror of git://git.suckless.org/dwm
removed artefacts of single-linked list (thanx to Jukka, I must have been mad)
This commit is contained in:
parent
7c2e3bb67d
commit
d9a6a3b5d2
11
client.c
11
client.c
|
@ -416,20 +416,18 @@ togglemax(Arg *arg)
|
||||||
void
|
void
|
||||||
unmanage(Client *c)
|
unmanage(Client *c)
|
||||||
{
|
{
|
||||||
Client **l;
|
|
||||||
|
|
||||||
XGrabServer(dpy);
|
XGrabServer(dpy);
|
||||||
XSetErrorHandler(xerrordummy);
|
XSetErrorHandler(xerrordummy);
|
||||||
|
|
||||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||||
XDestroyWindow(dpy, c->title);
|
XDestroyWindow(dpy, c->title);
|
||||||
|
|
||||||
for(l = &clients; *l && *l != c; l = &(*l)->next);
|
|
||||||
if(c->prev)
|
if(c->prev)
|
||||||
c->prev->next = c->next;
|
c->prev->next = c->next;
|
||||||
if(c->next)
|
if(c->next)
|
||||||
c->next->prev = c->prev;
|
c->next->prev = c->prev;
|
||||||
*l = c->next;
|
if(c == clients)
|
||||||
|
clients = c->next;
|
||||||
if(sel == c) {
|
if(sel == c) {
|
||||||
sel = getnext(c->next);
|
sel = getnext(c->next);
|
||||||
if(!sel)
|
if(!sel)
|
||||||
|
@ -450,7 +448,7 @@ unmanage(Client *c)
|
||||||
void
|
void
|
||||||
zoom(Arg *arg)
|
zoom(Arg *arg)
|
||||||
{
|
{
|
||||||
Client *c, **l;
|
Client *c;
|
||||||
|
|
||||||
if(!sel)
|
if(!sel)
|
||||||
return;
|
return;
|
||||||
|
@ -461,13 +459,10 @@ zoom(Arg *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* pop */
|
/* pop */
|
||||||
for(l = &clients; *l && *l != sel; l = &(*l)->next);
|
|
||||||
if(sel->prev)
|
if(sel->prev)
|
||||||
sel->prev->next = sel->next;
|
sel->prev->next = sel->next;
|
||||||
if(sel->next)
|
if(sel->next)
|
||||||
sel->next->prev = sel->prev;
|
sel->next->prev = sel->prev;
|
||||||
*l = sel->next;
|
|
||||||
|
|
||||||
sel->prev = NULL;
|
sel->prev = NULL;
|
||||||
if(clients)
|
if(clients)
|
||||||
clients->prev = sel;
|
clients->prev = sel;
|
||||||
|
|
Loading…
Reference in New Issue