aewl

diff view.c @ 446:a2e587651c79

using a global stack for focus recovery on arrange() - seems to work great
author Anselm R. Garbe <arg@10kloc.org>
date Thu, 07 Sep 2006 17:53:40 +0200
parents 548084f8d92e
children 728c9089b079
line diff
     1.1 --- a/view.c	Thu Sep 07 09:26:01 2006 +0200
     1.2 +++ b/view.c	Thu Sep 07 17:53:40 2006 +0200
     1.3 @@ -76,8 +76,10 @@
     1.4  		else
     1.5  			ban(c);
     1.6  	}
     1.7 -	if(!sel || !isvisible(sel))
     1.8 -		focus(getnext(clients));
     1.9 +	if(!sel || !isvisible(sel)) {
    1.10 +		for(sel = stack; sel && !isvisible(sel); sel = sel->snext);
    1.11 +		focus(sel);
    1.12 +	}
    1.13  	restack();
    1.14  }
    1.15  
    1.16 @@ -138,8 +140,10 @@
    1.17  		else
    1.18  			ban(c);
    1.19  	}
    1.20 -	if(!sel || !isvisible(sel))
    1.21 -		focus(getnext(clients));
    1.22 +	if(!sel || !isvisible(sel)) {
    1.23 +		for(sel = stack; sel && !isvisible(sel); sel = sel->snext);
    1.24 +		focus(sel);
    1.25 +	}
    1.26  	restack();
    1.27  }
    1.28  
    1.29 @@ -227,7 +231,7 @@
    1.30  		XRaiseWindow(dpy, sel->win);
    1.31  		XRaiseWindow(dpy, sel->twin);
    1.32  	}
    1.33 -	if(arrange != dofloat) 
    1.34 +	if(arrange != dofloat)
    1.35  		for(c = nexttiled(clients); c; c = nexttiled(c->next)) {
    1.36  			XLowerWindow(dpy, c->twin);
    1.37  			XLowerWindow(dpy, c->win);