From 814587e33e5d4298bdee769429ceeeae2b094923 Mon Sep 17 00:00:00 2001 From: Joseph <119084558+DerjenigeUberMensch@users.noreply.github.com> Date: Fri, 23 Aug 2024 00:14:27 +0000 Subject: [PATCH] Fixed race condtions when unmanaging (#405) --- src/events.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/events.c b/src/events.c index 2dfc9e2..82be0fc 100644 --- a/src/events.c +++ b/src/events.c @@ -983,7 +983,14 @@ destroynotify(XCBGenericEvent *event) u8 sync = 0; - PropListen(_wm.handler, _wm.dpy, win, PropUnmanage); + Client *c = wintoclient(win); + + if(c) + { + unmanage(c, 1); + /* unused due to race conditions */ + /* PropListen(_wm.handler, _wm.dpy, win, PropUnmanage); */ + } if(sync) { XCBFlush(_wm.dpy); @@ -1055,7 +1062,14 @@ unmapnotify(XCBGenericEvent *event) u8 sync = 0; - PropListen(_wm.handler, _wm.dpy, win, PropUnmanage); + Client *c = wintoclient(win); + + if(c) + { + unmanage(c, 1); + /* unused due to race conditions */ + /* PropListen(_wm.handler, _wm.dpy, win, PropUnmanage); */ + } if(sync) { XCBFlush(_wm.dpy);