win: handle restack to bottom correctly
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
@ -1040,6 +1040,9 @@ void add_win(session_t *ps, xcb_window_t id, xcb_window_t prev) {
|
||||
}
|
||||
new->prev = p;
|
||||
*p = new;
|
||||
if (p == ps->window_stack_bottom) {
|
||||
ps->window_stack_bottom = &new->next;
|
||||
}
|
||||
HASH_ADD_INT(ps->windows, id, new);
|
||||
|
||||
#ifdef CONFIG_DBUS
|
||||
@ -1494,6 +1497,9 @@ static void finish_destroy_win(session_t *ps, win **_w) {
|
||||
if (w->next) {
|
||||
w->next->prev = w->prev;
|
||||
}
|
||||
if (&w->next == ps->window_stack_bottom) {
|
||||
ps->window_stack_bottom = w->prev;
|
||||
}
|
||||
|
||||
if (w == ps->active_win) {
|
||||
ps->active_win = NULL;
|
||||
|
Reference in New Issue
Block a user