if(!matched)
                for(i = 0; i < ntags; i++)
                        c->tags[i] = seltag[i];
+       for(i = 0; i < ntags && !c->tags[i]; i++);
+       c->weight = i;
 }
 
 void
                sel->tags[i] = False;
        sel->tags[arg->i] = True;
        settitle(sel);
-       detach(sel);
-       attach(sel);
        if(!isvisible(sel))
                arrange(NULL);
        else
        if(i == ntags)
                sel->tags[arg->i] = True;
        settitle(sel);
-       detach(sel);
-       attach(sel);
        if(!isvisible(sel))
                arrange(NULL);
        else