X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tag.c;h=ddffafa16e5a31d827a7e999a7692cc9edbe4c71;hb=157ea539a2d1926ee3a9d2fe713eba0b9428f685;hp=a2e1c8994d1ba5987a738c7a028769789347be19;hpb=c3c94c0e0a4da1562b040a17ee670312ad8e65af;p=dwm.git diff --git a/tag.c b/tag.c index a2e1c89..ddffafa 100644 --- a/tag.c +++ b/tag.c @@ -30,6 +30,17 @@ RULES static RReg *rreg = NULL; static unsigned int len = 0; +static void +applytag() +{ + /* asserts sel != NULL */ + settitle(sel); + if(!isvisible(sel)) + arrange(NULL); + else + drawstatus(); +} + /* extern */ Client * @@ -121,11 +132,7 @@ tag(Arg *arg) for(i = 0; i < ntags; i++) sel->tags[i] = False; sel->tags[arg->i] = True; - settitle(sel); - if(!isvisible(sel)) - arrange(NULL); - else - drawstatus(); + applytag(); } void @@ -140,9 +147,5 @@ toggletag(Arg *arg) for(i = 0; i < ntags && !sel->tags[i]; i++); if(i == ntags) sel->tags[arg->i] = True; - settitle(sel); - if(!isvisible(sel)) - arrange(NULL); - else - drawstatus(); + applytag(); }