# HG changeset patch # User Anselm R Garbe # Date 1220005782 -3600 # Node ID 56c2529afeabf812b0169c86f1c9f3fc7ca81e85 # Parent 18098673e4178bb381243cb2a3ec2a14175f1d47 fixed diff -r 18098673e417 -r 56c2529afeab dwm.c --- a/dwm.c Fri Aug 29 10:13:47 2008 +0100 +++ b/dwm.c Fri Aug 29 11:29:42 2008 +0100 @@ -250,21 +250,21 @@ XClassHint ch = { 0 }; /* rule matching */ - if(XGetClassHint(dpy, c->win, &ch) == 0) - return; - for(i = 0; i < LENGTH(rules); i++) { - r = &rules[i]; - if((!r->title || strstr(c->name, r->title)) - && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) - && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { - c->isfloating = r->isfloating; - c->tags |= r->tags & TAGMASK; + if(XGetClassHint(dpy, c->win, &ch)) { + for(i = 0; i < LENGTH(rules); i++) { + r = &rules[i]; + if((!r->title || strstr(c->name, r->title)) + && (!r->class || (ch.res_class && strstr(ch.res_class, r->class))) + && (!r->instance || (ch.res_name && strstr(ch.res_name, r->instance)))) { + c->isfloating = r->isfloating; + 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) c->tags = tagset[seltags]; }