diff options
| author | bakkeby <[email protected]> | 2020-06-15 21:01:05 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-06-15 21:01:05 +0200 |
| commit | 5e0a9c49f8d4f70616282b50bead1efcbcc20e94 (patch) | |
| tree | bc83c7f3e2a921c46812379cbe7494a93d3a34a9 /patch | |
| parent | 920c58421b6107a386f60d1f52bd3c83fee6d40d (diff) | |
| download | dwm-flexipatch-5e0a9c49f8d4f70616282b50bead1efcbcc20e94.tar.gz dwm-flexipatch-5e0a9c49f8d4f70616282b50bead1efcbcc20e94.zip | |
Adding sizehints patch
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/include.c | 3 | ||||
| -rw-r--r-- | patch/include.h | 3 | ||||
| -rw-r--r-- | patch/sizehints_ruled.c | 24 | ||||
| -rw-r--r-- | patch/sizehints_ruled.h | 1 |
4 files changed, 31 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c index 9d88b94..77abf89 100644 --- a/patch/include.c +++ b/patch/include.c @@ -117,6 +117,9 @@ #if SHIFTVIEW_CLIENTS_PATCH #include "shiftviewclients.c" #endif +#if SIZEHINTS_RULED_PATCH +#include "sizehints_ruled.c" +#endif #if SORTSCREENS_PATCH #ifdef XINERAMA #include "sortscreens.c" diff --git a/patch/include.h b/patch/include.h index bb91ee2..93442f1 100644 --- a/patch/include.h +++ b/patch/include.h @@ -120,6 +120,9 @@ #if SHIFTVIEW_CLIENTS_PATCH #include "shiftviewclients.h" #endif +#if SIZEHINTS_RULED_PATCH +#include "sizehints_ruled.h" +#endif #if SORTSCREENS_PATCH #ifdef XINERAMA #include "sortscreens.h" diff --git a/patch/sizehints_ruled.c b/patch/sizehints_ruled.c new file mode 100644 index 0000000..885707f --- /dev/null +++ b/patch/sizehints_ruled.c @@ -0,0 +1,24 @@ +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); +} diff --git a/patch/sizehints_ruled.h b/patch/sizehints_ruled.h new file mode 100644 index 0000000..d21b2e4 --- /dev/null +++ b/patch/sizehints_ruled.h @@ -0,0 +1 @@ +static void checkfloatingrules(Client *c);
\ No newline at end of file |
