mirror of
https://github.com/vale981/spectrwm
synced 2025-03-05 09:51:38 -05:00
Add simple heuristic to max_stack focus to deal with new event reality.
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.
This commit is contained in:
parent
05347c2d3e
commit
80e76b8191
1 changed files with 6 additions and 6 deletions
12
scrotwm.c
12
scrotwm.c
|
@ -1678,13 +1678,12 @@ focus_prev(struct ws_win *win)
|
|||
}
|
||||
|
||||
/* if in max_stack try harder */
|
||||
/* XXX needs more love */
|
||||
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;
|
||||
}
|
||||
|
||||
if (cur_focus == win)
|
||||
|
@ -1696,6 +1695,7 @@ focus_prev(struct ws_win *win)
|
|||
done:
|
||||
if (winfocus == winlostfocus || winfocus == NULL)
|
||||
return;
|
||||
focusanyway:
|
||||
focus_magic(winfocus, SWM_F_GENERIC);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue