This mostly uses the same logic as a normal stack but it detects if the
previous window got unmapped and goes back to the parent. The rest is
the same code as stacked focusing.
}
/* if in max_stack try harder */
}
/* if in max_stack try harder */
- /* XXX needs more love */
if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
- if (cur_focus != ws->focus_prev)
- winfocus = ws->focus_prev;
- else if (cur_focus != ws->focus)
- winfocus = ws->focus;
- goto done;
+ /* window got unmapped go to parent which is now cur_focus */
+ if (ws->focus_prev == win)
+ winfocus = cur_focus;
+ if (winfocus)
+ goto focusanyway;
done:
if (winfocus == winlostfocus || winfocus == NULL)
return;
done:
if (winfocus == winlostfocus || winfocus == NULL)
return;
focus_magic(winfocus, SWM_F_GENERIC);
}
focus_magic(winfocus, SWM_F_GENERIC);
}