[hackers] [dwm] applied Connors cleanup patch of Eckehards proposed fix of applyrules(), thanks everyone involved || garbeam

From: <hg_AT_suckless.org>
Date: Mon, 15 Aug 2011 18:44:56 +0200 (CEST)

changeset: 1575:b899c8748939
tag: tip
user: garbeam_AT_gmail.com
date: Mon Aug 15 18:44:12 2011 +0200
files: dwm.c
description:
applied Connors cleanup patch of Eckehards proposed fix of applyrules(), thanks everyone involved

diff -r edf3fc1e74b9 -r b899c8748939 dwm.c
--- a/dwm.c Mon Aug 08 16:55:06 2011 +0000
+++ b/dwm.c Mon Aug 15 18:44:12 2011 +0200
@@ -289,31 +289,31 @@
         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];
 }
 
Received on Mon Aug 15 2011 - 18:44:56 CEST

This archive was generated by hypermail 2.2.0 : Mon Aug 15 2011 - 18:48:04 CEST