My only thought is that the XGetClassHint in applyrules is failing and
so the rules are never applied.... try this (untested) patch...
Jeremy
On Mon 16 Feb 2009 - 12:58PM, Adam wrote:
> hello. I have a program which opens a graphics display window which I
> would like to always be floating. xprop for the window returns only:
>
> WM_STATE(WM_STATE):
> window state: Normal
> icon window: 0x0
> WM_HINTS(WM_HINTS):
> Client accepts input or input focus: False
> WM_NAME(STRING) = "<GREG"
>
> I have tried using "<GREG" in every permutation possible in the rules
> of config.h, but that doesnt work. Is there any other way to get such
> a window to always float?
>
> thanks,
> -adam.
>
diff -r a98f0e8ea6cb dwm.c
--- a/dwm.c Sat Feb 14 11:21:24 2009 +0000
+++ b/dwm.c Mon Feb 16 09:10:02 2009 -0500
@@ -257,21 +257,22 @@
void
applyrules(Client *c) {
- unsigned int i;
+ unsigned int i, xh=0;
Rule *r;
XClassHint ch = { 0 };
/* rule matching */
- 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 ? r->tags &
TAGMASK : tagset[seltags];
- }
+ xh = 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 || (xh && ch.res_class && strstr(ch.res_class,
r->class)))
+ && (!r->instance || (xh && ch.res_name && strstr(ch.res_name,
r->instance)))) {
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags & TAGMASK ? r->tags & TAGMASK :
tagset[seltags];
}
+ }
+ if( xh ) {
if(ch.res_class)
XFree(ch.res_class);
if(ch.res_name)