Adding sizehints patch

This commit is contained in:
bakkeby
2020-06-15 21:01:05 +02:00
parent 920c58421b
commit 5e0a9c49f8
7 changed files with 67 additions and 0 deletions

14
dwm.c
View File

@@ -3950,7 +3950,11 @@ updatesizehints(Client *c)
if (!XGetWMNormalHints(dpy, c->win, &size, &msize))
/* size is uninitialized, ensure that size.flags aren't used */
#if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH
size.flags = 0;
#else
size.flags = PSize;
#endif // SIZEHINTS_PATCH | SIZEHINTS_RULED_PATCH
if (size.flags & PBaseSize) {
c->basew = size.base_width;
c->baseh = size.base_height;
@@ -3982,6 +3986,16 @@ updatesizehints(Client *c)
c->maxa = (float)size.max_aspect.x / size.max_aspect.y;
} else
c->maxa = c->mina = 0.0;
#if SIZEHINTS_PATCH || SIZEHINTS_RULED_PATCH
if (size.flags & PSize) {
c->basew = size.base_width;
c->baseh = size.base_height;
c->isfloating = 1;
}
#if SIZEHINTS_RULED_PATCH
checkfloatingrules(c);
#endif // SIZEHINTS_RULED_PATCH
#endif // SIZEHINTS_PATCH
c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
}