layout restore: remove remaining criteria when swallowing window

fixes #1817
This commit is contained in:
Michael Stapelberg
2015-08-06 21:35:34 +02:00
parent 0fb784f5cb
commit f76a2fdf68
2 changed files with 91 additions and 0 deletions

View File

@ -301,6 +301,13 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
if (nc->window != NULL && nc->window != cwindow) {
if (!restore_kill_placeholder(nc->window->id)) {
DLOG("Uh?! Container without a placeholder, but with a window, has swallowed this to-be-managed window?!\n");
} else {
/* Remove remaining criteria, the first swallowed window wins. */
while (!TAILQ_EMPTY(&(nc->swallow_head))) {
Match *first = TAILQ_FIRST(&(nc->swallow_head));
TAILQ_REMOVE(&(nc->swallow_head), first, matches);
match_free(first);
}
}
}
nc->window = cwindow;