aewl

changeset 431:a230e4432bb7

moved transient_for tag inheritance to settags
author Anselm R. Garbe <arg@10kloc.org>
date Wed, 06 Sep 2006 09:21:17 +0200
parents 1e8aba00964e
children 0f94ee451f6c
files client.c dwm.h tag.c
diffstat 3 files changed, 10 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/client.c	Wed Sep 06 09:13:31 2006 +0200
     1.2 +++ b/client.c	Wed Sep 06 09:21:17 2006 +0200
     1.3 @@ -199,7 +199,7 @@
     1.4  manage(Window w, XWindowAttributes *wa)
     1.5  {
     1.6  	unsigned int i;
     1.7 -	Client *c, *tc;
     1.8 +	Client *c;
     1.9  	Window trans;
    1.10  	XSetWindowAttributes twa;
    1.11  
    1.12 @@ -238,11 +238,7 @@
    1.13  			CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa);
    1.14  
    1.15  	grabbuttons(c, False);
    1.16 -	if((tc = getclient(trans))) /* inherit tags */
    1.17 -		for(i = 0; i < ntags; i++)
    1.18 -			c->tags[i] = tc->tags[i];
    1.19 -	else
    1.20 -		settags(c);
    1.21 +	settags(c, getclient(trans));
    1.22  	if(!c->isfloat)
    1.23  		c->isfloat = trans
    1.24  			|| (c->maxw && c->minw &&
     2.1 --- a/dwm.h	Wed Sep 06 09:13:31 2006 +0200
     2.2 +++ b/dwm.h	Wed Sep 06 09:21:17 2006 +0200
     2.3 @@ -115,7 +115,7 @@
     2.4  extern void initrregs();
     2.5  extern Client *getnext(Client *c);
     2.6  extern Client *getprev(Client *c);
     2.7 -extern void settags(Client *c);
     2.8 +extern void settags(Client *c, Client *trans);
     2.9  extern void tag(Arg *arg);
    2.10  extern void toggletag(Arg *arg);
    2.11  
     3.1 --- a/tag.c	Wed Sep 06 09:13:31 2006 +0200
     3.2 +++ b/tag.c	Wed Sep 06 09:21:17 2006 +0200
     3.3 @@ -76,15 +76,19 @@
     3.4  }
     3.5  
     3.6  void
     3.7 -settags(Client *c)
     3.8 +settags(Client *c, Client *trans)
     3.9  {
    3.10  	char prop[512];
    3.11  	unsigned int i, j;
    3.12  	regmatch_t tmp;
    3.13 -	Bool matched = False;
    3.14 +	Bool matched = trans != NULL;
    3.15  	XClassHint ch;
    3.16  
    3.17 -	if(XGetClassHint(dpy, c->win, &ch)) {
    3.18 +	if(matched) {
    3.19 +		for(i = 0; i < ntags; i++)
    3.20 +			c->tags[i] = trans->tags[i];
    3.21 +	}
    3.22 +	else if(XGetClassHint(dpy, c->win, &ch)) {
    3.23  		snprintf(prop, sizeof(prop), "%s:%s:%s",
    3.24  				ch.res_class ? ch.res_class : "",
    3.25  				ch.res_name ? ch.res_name : "", c->name);