JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed viewall(), replaced with view(-1); added tag(-1) to tag a client with all...
[dwm.git] / tag.c
diff --git a/tag.c b/tag.c
index 798fd0a..20a0a17 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -50,7 +50,7 @@ initrregs(void) {
 
        if(rreg)
                return;
-       len = sizeof(rule) / sizeof(rule[0]);
+       len = sizeof rule / sizeof rule[0];
        rreg = emallocz(len * sizeof(RReg));
        for(i = 0; i < len; i++) {
                if(rule[i].clpattern) {
@@ -83,7 +83,7 @@ settags(Client *c, Client *trans) {
                        c->tags[i] = trans->tags[i];
        }
        else if(XGetClassHint(dpy, c->win, &ch)) {
-               snprintf(prop, sizeof(prop), "%s:%s:%s",
+               snprintf(prop, sizeof prop, "%s:%s:%s",
                                ch.res_class ? ch.res_class : "",
                                ch.res_name ? ch.res_name : "", c->name);
                for(i = 0; !matched && i < len; i++)
@@ -104,7 +104,6 @@ settags(Client *c, Client *trans) {
        if(!matched)
                for(i = 0; i < ntags; i++)
                        c->tags[i] = seltag[i];
-       for(c->weight = 0; c->weight < ntags && !c->tags[c->weight]; c->weight++);
 }
 
 void
@@ -114,9 +113,8 @@ tag(Arg *arg) {
        if(!sel)
                return;
        for(i = 0; i < ntags; i++)
-               sel->tags[i] = False;
+               sel->tags[i] = (arg->i == -1) ? True : False;
        sel->tags[arg->i] = True;
-       sel->weight = arg->i;
        arrange();
 }
 
@@ -130,6 +128,5 @@ toggletag(Arg *arg) {
        for(i = 0; i < ntags && !sel->tags[i]; i++);
        if(i == ntags)
                sel->tags[arg->i] = True;
-       sel->weight = (i == ntags) ? arg->i : i;
        arrange();
 }