Skip to content

Commit

Permalink
event: destroy: unmark client when a client window is destroyed
Browse files Browse the repository at this point in the history
We do nothing when a non-wm-frame window is destroyed. This will cause
trouble if a wm-frame window is reused (i.e. its child is destroyed then
a new child is reparented to it), because we didn't clear client_win.

So this commit adds a call to win_unmark_client for that case.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information
yshui committed Apr 5, 2020
1 parent 68fa49c commit b652e8b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,21 @@ static inline void ev_configure_notify(session_t *ps, xcb_configure_notify_event

static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *ev) {
auto w = find_win(ps, ev->window);
if (w) {
auto mw = find_toplevel(ps, ev->window);
if (mw && mw->client_win == mw->base.id) {
// We only want _real_ frame window
assert(&mw->base == w);
mw = NULL;
}
assert(w == NULL || mw == NULL);

if (w != NULL) {
auto _ attr_unused = destroy_win_start(ps, w);
} else if (mw != NULL) {
win_unmark_client(ps, mw);
} else {
log_debug("Received a destroy notify from an unknown window, %#010x",
ev->window);
}
}

Expand Down

0 comments on commit b652e8b

Please sign in to comment.