diff options
Diffstat (limited to 'patch/sizehints_ruled.c')
| -rw-r--r-- | patch/sizehints_ruled.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patch/sizehints_ruled.c b/patch/sizehints_ruled.c new file mode 100644 index 0000000..99c7e62 --- /dev/null +++ b/patch/sizehints_ruled.c @@ -0,0 +1,25 @@ +void +checkfloatingrules(Client *c) +{ + const char *class, *instance; + unsigned int i; + const Rule *r; + XClassHint ch = { NULL, NULL }; + + 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; + } + if (ch.res_class) + XFree(ch.res_class); + if (ch.res_name) + XFree(ch.res_name); +} + |
