dwm-meillo

changeset 151:e1859517e3a6

removed artefacts of single-linked list (thanx to Jukka, I must have been mad)
author arg@10ksloc.org
date Tue, 01 Aug 2006 16:14:17 +0200
parents a26b32ff8911
children 4a64fd270e47
files client.c dwm.1
diffstat 2 files changed, 4 insertions(+), 9 deletions(-) [+]
line diff
     1.1 --- a/client.c	Tue Aug 01 15:29:37 2006 +0200
     1.2 +++ b/client.c	Tue Aug 01 16:14:17 2006 +0200
     1.3 @@ -416,20 +416,18 @@
     1.4  void
     1.5  unmanage(Client *c)
     1.6  {
     1.7 -	Client **l;
     1.8 -
     1.9  	XGrabServer(dpy);
    1.10  	XSetErrorHandler(xerrordummy);
    1.11  
    1.12  	XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
    1.13  	XDestroyWindow(dpy, c->title);
    1.14  
    1.15 -	for(l = &clients; *l && *l != c; l = &(*l)->next);
    1.16  	if(c->prev)
    1.17  		c->prev->next = c->next;
    1.18  	if(c->next)
    1.19  		c->next->prev = c->prev;
    1.20 -	*l = c->next;
    1.21 +	if(c == clients)
    1.22 +		clients = c->next;
    1.23  	if(sel == c) {
    1.24  		sel = getnext(c->next);
    1.25  		if(!sel)
    1.26 @@ -450,7 +448,7 @@
    1.27  void
    1.28  zoom(Arg *arg)
    1.29  {
    1.30 -	Client *c, **l;
    1.31 +	Client *c;
    1.32  
    1.33  	if(!sel)
    1.34  		return;
    1.35 @@ -461,13 +459,10 @@
    1.36  	}
    1.37  
    1.38  	/* pop */
    1.39 -	for(l = &clients; *l && *l != sel; l = &(*l)->next);
    1.40  	if(sel->prev)
    1.41  		sel->prev->next = sel->next;
    1.42  	if(sel->next)
    1.43  		sel->next->prev = sel->prev;
    1.44 -	*l = sel->next;
    1.45 -
    1.46  	sel->prev = NULL;
    1.47  	if(clients)
    1.48  		clients->prev = sel;
     2.1 --- a/dwm.1	Tue Aug 01 15:29:37 2006 +0200
     2.2 +++ b/dwm.1	Tue Aug 01 16:14:17 2006 +0200
     2.3 @@ -1,4 +1,4 @@
     2.4 -.TH DWM 1 dwm-0.5
     2.5 +.TH DWM 1 dwm-0.6
     2.6  .SH NAME
     2.7  dwm \- dynamic window manager
     2.8  .SH SYNOPSIS