- if(XGetClassHint(dpy, c->win, &ch)) {
- if(ch.res_class && ch.res_name) {
- for(i = 0; i < len; i++)
- if(!strncmp(rule[i].class, ch.res_class, sizeof(rule[i].class))
- && !strncmp(rule[i].instance, ch.res_name, sizeof(rule[i].instance)))
- {
- for(j = 0; j < TLast; j++)
- c->tags[j] = rule[i].tags[j];
- c->dofloat = rule[i].dofloat;
- matched = True;
- break;
+ if(matched) {
+ for(i = 0; i < ntags; i++)
+ c->tags[i] = trans->tags[i];
+ }
+ else {
+ XGetClassHint(dpy, c->win, &ch);
+ snprintf(prop, sizeof prop, "%s:%s:%s",
+ ch.res_class ? ch.res_class : "",
+ ch.res_name ? ch.res_name : "", c->name);
+ for(i = 0; i < len; i++)
+ if(rreg[i].clregex && !regexec(rreg[i].clregex, prop, 1, &tmp, 0)) {
+ c->isfloat = rule[i].isfloat;
+ for(j = 0; rreg[i].tregex && j < ntags; j++) {
+ if(!regexec(rreg[i].tregex, tags[j], 1, &tmp, 0)) {
+ matched = True;
+ c->tags[j] = True;
+ }