From e15731f6cb4a3e2533d7854a59339bcf818e0fb3 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Sat, 11 Apr 2020 02:23:58 +0100 Subject: [PATCH] event: reparent: make sure windows are destroyed when they are reparented Make sure the window struct is indeed destroyed and freed when a window is reparented away from root. So we won't find it later and get confused. Signed-off-by: Yuxuan Shui --- src/event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/event.c b/src/event.c index 31026b7..80d6067 100644 --- a/src/event.c +++ b/src/event.c @@ -343,7 +343,11 @@ static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t { auto w = find_win(ps, ev->window); if (w) { - auto _ attr_unused = destroy_win_start(ps, w); + auto ret = destroy_win_start(ps, w); + if (!ret && w->managed) { + auto mw = (struct managed_win *)w; + CHECK(win_skip_fading(ps, mw)); + } } }