win: handle destruction of unmanaged window

Previous destructions of unmanaged window are silently ignored, causing
windows with duplicated IDs.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-04-19 02:15:31 +01:00
parent 883d8c9142
commit 927cdd8652
3 changed files with 24 additions and 4 deletions

View File

@ -1621,6 +1621,16 @@ static void finish_map_win(session_t *ps, struct managed_win **_w) {
w->state = WSTATE_MAPPED;
}
void destroy_unmanaged_win(session_t *ps, struct win **_w) {
auto w = *_w;
assert(!w->managed);
assert(!w->destroyed);
list_remove(&w->stack_neighbour);
HASH_DEL(ps->windows, w);
free(w);
*_w = NULL;
}
void unmap_win(session_t *ps, struct managed_win **_w, bool destroy) {
auto w = *_w;