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 <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2020-04-11 02:23:58 +01:00
parent e341267e8a
commit e15731f6cb
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 5 additions and 1 deletions

View File

@ -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); auto w = find_win(ps, ev->window);
if (w) { 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));
}
} }
} }