aboutsummaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorgarbeam@gmail.com <unknown>2011-08-15 18:44:12 +0200
committergarbeam@gmail.com <unknown>2011-08-15 18:44:12 +0200
commit0f1f30daca0eaf0a400fd3f8d274594c07b32a51 (patch)
tree058d3077c6d1af74c08836947d137f144ae221f6 /dwm.c
parentdec4850d0586f34f0dc69ed5285afefeefef90ae (diff)
downloaddwm-0f1f30daca0eaf0a400fd3f8d274594c07b32a51.tar.gz
dwm-0f1f30daca0eaf0a400fd3f8d274594c07b32a51.tar.bz2
dwm-0f1f30daca0eaf0a400fd3f8d274594c07b32a51.zip
applied Connors cleanup patch of Eckehards proposed fix of applyrules(), thanks everyone involved
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/dwm.c b/dwm.c
index 6909969..39b0a51 100644
--- a/dwm.c
+++ b/dwm.c
@@ -289,31 +289,31 @@ applyrules(Client *c) {
unsigned int i;
const Rule *r;
Monitor *m;
- XClassHint ch = { 0 };
+ XClassHint ch = { NULL, NULL };
/* rule matching */
c->isfloating = c->tags = 0;
- if(XGetClassHint(dpy, c->win, &ch)) {
- class = ch.res_class ? ch.res_class : broken;
- instance = ch.res_name ? ch.res_name : broken;
- for(i = 0; i < LENGTH(rules); i++) {
- r = &rules[i];
- if((!r->title || strstr(c->name, r->title))
- && (!r->class || strstr(class, r->class))
- && (!r->instance || strstr(instance, r->instance)))
- {
- c->isfloating = r->isfloating;
- c->tags |= r->tags;
- for(m = mons; m && m->num != r->monitor; m = m->next);
- if(m)
- c->mon = m;
- }
+ XGetClassHint(dpy, c->win, &ch);
+ class = ch.res_class ? ch.res_class : broken;
+ instance = ch.res_name ? ch.res_name : broken;
+
+ for(i = 0; i < LENGTH(rules); i++) {
+ r = &rules[i];
+ if((!r->title || strstr(c->name, r->title))
+ && (!r->class || strstr(class, r->class))
+ && (!r->instance || strstr(instance, r->instance)))
+ {
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags;
+ for(m = mons; m && m->num != r->monitor; m = m->next);
+ if(m)
+ c->mon = m;
}
- 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);
c->tags = c->tags & TAGMASK ? c->tags & TAGMASK : c->mon->tagset[c->mon->seltags];
}