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:
10
src/win.c
10
src/win.c
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user