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

View File

@ -1,4 +1,4 @@
This dwm 6.3 (d39e2f3, 2022-01-07) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0). This dwm 6.3 (bece862, 2022-03-13) side project has a different take on dwm patching. It uses preprocessor directives to decide whether or not to include a patch during build time. Essentially this means that this build, for better or worse, contains both the patched _and_ the original code. The aim being that you can select which patches to include and the build will contain that code and nothing more. Due to the complexity of some of the patches dwm-flexipatch has diverged from mainstream dwm by making some core patches non-optional for maintenance reasons. For the classic dwm-flexipatch build refer to branch [dwm-flexipatch-1.0](https://github.com/bakkeby/dwm-flexipatch/tree/dwm-flexipatch-1.0).
For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h): For example to include the `alpha` patch then you would only need to flip this setting from 0 to 1 in [patches.h](https://github.com/bakkeby/dwm-flexipatch/blob/master/patches.def.h):
```c ```c

4
dwm.c
View File

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