Still one weird focus bug leftover where when the last window in a ws gets
destroyed and if there is a window on the alternate screen it gets focus.
if (ws->cur_layout->l_stack == NULL)
ws->cur_layout = &layouts[0];
ignore_enter = 1;
if (ws->cur_layout->l_stack == NULL)
ws->cur_layout = &layouts[0];
ignore_enter = 1;
ws->focus = TAILQ_PREV(win, ws_win_list, entry);
if (ws->focus == NULL)
ws->focus = TAILQ_FIRST(&ws->winlist);
ws->focus = TAILQ_PREV(win, ws_win_list, entry);
if (ws->focus == NULL)
ws->focus = TAILQ_FIRST(&ws->winlist);
+ if (ws->focus == NULL || ws->focus == win) {
+ unfocus_all();
+ } else
TAILQ_REMOVE(&ws->winlist, win, entry);
set_win_state(win, WithdrawnState);
free(win);
TAILQ_REMOVE(&ws->winlist, win, entry);
set_win_state(win, WithdrawnState);
free(win);