JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
pplied Sanders appendtag patch
[dwm.git] / tag.c
diff --git a/tag.c b/tag.c
index 01979d5..b5bebea 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -37,11 +37,15 @@ void (*arrange)(Arg *) = DEFMODE;
 void
 appendtag(Arg *arg)
 {
-       if(!sel)
+       Client *c = sel;
+
+       if(!c)
                return;
 
-       sel->tags[arg->i] = True;
+       c->tags[arg->i] = True;
        arrange(NULL);
+       focus(c);
+       restack();
 }
 
 void
@@ -211,8 +215,10 @@ restack()
                        else
                                m++;
                }
-
-       n = 2 * (f + m);
+       if(!(n = 2 * (f + m))) {
+               drawstatus();
+               return;
+       }
        if(nwins < n) {
                nwins = n;
                wins = erealloc(wins, nwins * sizeof(Window));