This commit is contained in:
Anselm R Garbe 2008-08-29 11:29:42 +01:00
parent 26f41c9055
commit addc52c948

26
dwm.c
View file

@ -250,21 +250,21 @@ applyrules(Client *c) {
XClassHint ch = { 0 }; XClassHint ch = { 0 };
/* rule matching */ /* rule matching */
if(XGetClassHint(dpy, c->win, &ch) == 0) if(XGetClassHint(dpy, c->win, &ch)) {
return; for(i = 0; i < LENGTH(rules); i++) {
for(i = 0; i < LENGTH(rules); i++) { r = &rules[i];
r = &rules[i]; if((!r->title || strstr(c->name, r->title))
if((!r->title || strstr(c->name, r->title)) && (!r->class || (ch.res_class && strstr(ch.res_class, r->class)))
&& (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) {
&& (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { c->isfloating = r->isfloating;
c->isfloating = r->isfloating; c->tags |= r->tags & TAGMASK;
c->tags |= r->tags & TAGMASK; }
} }
if(ch.res_class)
XFree(ch.res_class);
if(ch.res_name)
XFree(ch.res_name);
} }
if(ch.res_class)
XFree(ch.res_class);
if(ch.res_name)
XFree(ch.res_name);
if(!c->tags) if(!c->tags)
c->tags = tagset[seltags]; c->tags = tagset[seltags];
} }