Better version of BadDrawable fix patch. Workaround or not - it did the fix,
though still was not enough complete.

I changed cleanup() to mass-unmanage clients in more effective way,
without per-client unmanage(), leading to focus and memory tinkering.

Current cleanup() doesn't expect unmanage() clearing array, trying to focus
clients in order to remove, as if they were in array. Not sure if it's reason,
but for 5 clients only 3 where removed with original code before BadDrawable
error poped.
---
 tabbed.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tabbed.c b/tabbed.c
index 283911c..a7f663c 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -218,10 +218,11 @@ cleanup(void)
                focus(i);
                killclient(NULL);
                XReparentWindow(dpy, clients[i]->win, root, 0, 0);
-               unmanage(i);
+               free(clients[i]);
        }
        free(clients);
        clients = NULL;
+       XSync(dpy, False);
 
        XFreePixmap(dpy, dc.drawable);
        XFreeGC(dpy, dc.gc);
-- 
2.26.2


Reply via email to