On Fri, Aug 12, 2011 at 09:39:00PM +0200, Bastien Dejean wrote:
> I have included the following line in the rules array of my config.h :
> 
>     { NULL,     NULL,        "Event Tester",     0,            True,        
> -1 },
> 
> But I don't get the expected result (xev's window stays tiled).

Dwm doesn't seem to apply rules to clients without a class hint.
A fix could be something like this:

--------8<-----------8<-------
diff -r 131d4f6a8a1e dwm.c
--- a/dwm.c     Fri Jul 29 20:01:22 2011 +0200
+++ b/dwm.c     Sat Aug 13 10:31:14 2011 +0200
@@ -296,24 +296,25 @@
        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;
-                       }
+       } else
+               class = instance = 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];
 }
 
--------8<-----------8<-------

-- 
Eckehard Berns

Reply via email to