diff --git a/src/event.c b/src/event.c index 355aa33..739540d 100644 --- a/src/event.c +++ b/src/event.c @@ -270,11 +270,6 @@ static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t * if (w != NULL) { auto _ attr_unused = destroy_win_start(ps, w); } else if (mw != NULL) { - // XXX the hope here is the WM will destroy the frame window - // quickly after the client window is destroyed. Otherwise a - // frame window without a client window would linger around. Who - // knows what kind of bugs it could cause. This has caused at - // least one: #704 win_unmark_client(ps, mw); win_set_flags(mw, WIN_FLAGS_CLIENT_STALE); ps->pending_updates = true; diff --git a/src/win.c b/src/win.c index 25bfb8c..b8bfe76 100644 --- a/src/win.c +++ b/src/win.c @@ -2339,6 +2339,13 @@ bool destroy_win_start(session_t *ps, struct win *w) { add_damage_from_win(ps, mw); } + if (win_check_flags_all(mw, WIN_FLAGS_CLIENT_STALE)) { + mw->client_win = mw->base.id; + mw->wmwin = !mw->a.override_redirect; + log_debug("(%#010x): client self (%s)", mw->base.id, + (mw->wmwin ? "wmwin" : "override-redirected")); + } + // Clear some flags about stale window information. Because now // the window is destroyed, we can't update them anyway. win_clear_flags(mw, WIN_FLAGS_SIZE_STALE | WIN_FLAGS_POSITION_STALE |