manage: For isfloating/oldstate check/set, ensure trans client actually exists

In certain instances trans may be set to a window that doesn't actually
map to a client via wintoclient; in this case it doesn't make sense
to set isfloating/oldstate since trans is essentially invalid in that
case / correlates to the above condition check where trans is set /
XGetTransientForHint is called.

Ref.
https://git.suckless.org/dwm/commit/bece862a0fc4fc18ef9065b18cd28e2032d0d975.html
This commit is contained in:
bakkeby
2022-03-14 09:39:19 +01:00
parent da5e69c4a7
commit 8f93bb8931
2 changed files with 4 additions and 2 deletions

4
dwm.c
View File

@ -1773,7 +1773,9 @@ drawbar(Monitor *m)
{
Bar *bar;
#if !BAR_FLEXWINTITLE_PATCH
if (m->showbar)
#endif // BAR_FLEXWINTITLE_PATCH
for (bar = m->bar; bar; bar = bar->next)
drawbarwin(bar);
}
@ -2437,7 +2439,7 @@ manage(Window w, XWindowAttributes *wa)
#endif // MAXIMIZE_PATCH / EXRESIZE_PATCH
if (!c->isfloating)
c->isfloating = c->oldstate = trans != None || c->isfixed;
c->isfloating = c->oldstate = t || c->isfixed;
if (c->isfloating) {
XRaiseWindow(dpy, c->win);
XSetWindowBorder(dpy, w, scheme[SchemeNorm][ColFloat].pixel);