dwm-meillo

changeset 383:2ec9cead84a7

applied patch similiar proposed by dave tweed
author Anselm R. Garbe <arg@10kloc.org>
date Tue, 29 Aug 2006 17:11:37 +0200
parents 76b62c0c8c11
children 126e78129f1d
files tag.c
diffstat 1 files changed, 13 insertions(+), 10 deletions(-) [+]
line diff
     1.1 --- a/tag.c	Tue Aug 29 15:28:29 2006 +0200
     1.2 +++ b/tag.c	Tue Aug 29 17:11:37 2006 +0200
     1.3 @@ -30,6 +30,17 @@
     1.4  static RReg *rreg = NULL;
     1.5  static unsigned int len = 0;
     1.6  
     1.7 +static void
     1.8 +applytag()
     1.9 +{
    1.10 +	/* asserts sel != NULL */
    1.11 +	settitle(sel);
    1.12 +	if(!isvisible(sel))
    1.13 +		arrange(NULL);
    1.14 +	else
    1.15 +		drawstatus();
    1.16 +}
    1.17 +
    1.18  /* extern */
    1.19  
    1.20  Client *
    1.21 @@ -121,11 +132,7 @@
    1.22  	for(i = 0; i < ntags; i++)
    1.23  		sel->tags[i] = False;
    1.24  	sel->tags[arg->i] = True;
    1.25 -	settitle(sel);
    1.26 -	if(!isvisible(sel))
    1.27 -		arrange(NULL);
    1.28 -	else
    1.29 -		drawstatus();
    1.30 +	applytag();
    1.31  }
    1.32  
    1.33  void
    1.34 @@ -140,9 +147,5 @@
    1.35  	for(i = 0; i < ntags && !sel->tags[i]; i++);
    1.36  	if(i == ntags)
    1.37  		sel->tags[arg->i] = True;
    1.38 -	settitle(sel);
    1.39 -	if(!isvisible(sel))
    1.40 -		arrange(NULL);
    1.41 -	else
    1.42 -		drawstatus();
    1.43 +	applytag();
    1.44  }