event: destroy: recheck client instead of unmark client

We detach the client window from its frame when it's destroyed, so later
a new window can be attached to that frame. But turns out that's not
enough.

When i3 restarts, it attaches a placeholder window to the frame, then
the real window, and only after that, it will destroy the placeholder.
The real window will fail to attach as the frame already has a client.
When the placeholder is destroyed, we have to call recheck client to
pick up the real window that failed to attach previously.

Related: #299

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2020-04-05 22:41:45 +01:00
parent 481ac54f67
commit e9ab970989
3 changed files with 7 additions and 4 deletions

View File

@ -274,7 +274,7 @@ 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) {
win_unmark_client(ps, mw);
win_recheck_client(ps, mw);
} else {
log_debug("Received a destroy notify from an unknown window, %#010x",
ev->window);