[hackers] [tabbed][PATCH] More effective mass-unmanage in cleanup

From: Nikita Zlobin <nick87720z_AT_gmail.com>
Date: Fri, 12 Jun 2020 11:26:46 +0500

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
_AT_@ -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
Received on Fri Jun 12 2020 - 08:26:46 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 12 2020 - 08:36:30 CEST