diff options
| author | bakkeby <[email protected]> | 2022-02-11 09:44:40 +0100 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2022-02-11 11:43:36 +0100 |
| commit | a0751271bc6f3d45f165f750915e464f90336d0d (patch) | |
| tree | 90825862ec6f5323aa91b998689cc6872981f340 /patch | |
| parent | 8e36c36bcf4c5ba53949923d75ad46f984c12cbc (diff) | |
| download | dwm-flexipatch-a0751271bc6f3d45f165f750915e464f90336d0d.tar.gz dwm-flexipatch-a0751271bc6f3d45f165f750915e464f90336d0d.zip | |
sizehints ruled: have rule checks take window type and role into account ref. #229
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/sizehints_ruled.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/patch/sizehints_ruled.c b/patch/sizehints_ruled.c index 99c7e62..ce2eeb9 100644 --- a/patch/sizehints_ruled.c +++ b/patch/sizehints_ruled.c @@ -2,6 +2,10 @@ void checkfloatingrules(Client *c) { const char *class, *instance; + Atom wintype; + #if WINDOWROLERULE_PATCH + char role[64]; + #endif // WINDOWROLERULE_PATCH unsigned int i; const Rule *r; XClassHint ch = { NULL, NULL }; @@ -9,13 +13,23 @@ checkfloatingrules(Client *c) XGetClassHint(dpy, c->win, &ch); class = ch.res_class ? ch.res_class : broken; instance = ch.res_name ? ch.res_name : broken; + wintype = getatomprop(c, netatom[NetWMWindowType]); + #if WINDOWROLERULE_PATCH + gettextprop(c->win, wmatom[WMWindowRole], role, sizeof(role)); + #endif // WINDOWROLERULE_PATCH 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))) + #if WINDOWROLERULE_PATCH + && (!r->role || strstr(role, r->role)) + #endif // WINDOWROLERULE_PATCH + && (!r->instance || strstr(instance, r->instance)) + && (!r->wintype || wintype == XInternAtom(dpy, r->wintype, False))) + { c->isfloating = r->isfloating; + } } if (ch.res_class) XFree(ch.res_class); |
