In max stack we need to ignore all enternotifiy events.

Rever previous as part of this since it was a busted heuristic.
This commit is contained in:
Marco Peereboom 2009-10-23 20:56:37 +00:00
parent 80e76b8191
commit ce20e49d87

View file

@ -1679,11 +1679,14 @@ focus_prev(struct ws_win *win)
/* if in max_stack try harder */ /* if in max_stack try harder */
if (ws->cur_layout->flags & SWM_L_FOCUSPREV) { if (ws->cur_layout->flags & SWM_L_FOCUSPREV) {
/* window got unmapped go to parent which is now cur_focus */ if (cur_focus != ws->focus_prev)
if (ws->focus_prev == win) winfocus = ws->focus_prev;
winfocus = cur_focus; else if (cur_focus != ws->focus)
winfocus = ws->focus;
else
winfocus = TAILQ_PREV(win, ws_win_list, entry);
if (winfocus) if (winfocus)
goto focusanyway; goto done;
} }
if (cur_focus == win) if (cur_focus == win)
@ -1695,7 +1698,7 @@ focus_prev(struct ws_win *win)
done: done:
if (winfocus == winlostfocus || winfocus == NULL) if (winfocus == winlostfocus || winfocus == NULL)
return; return;
focusanyway:
focus_magic(winfocus, SWM_F_GENERIC); focus_magic(winfocus, SWM_F_GENERIC);
} }
@ -3970,6 +3973,10 @@ enternotify(XEvent *e)
if ((win = find_window(ev->window)) == NULL) if ((win = find_window(ev->window)) == NULL)
return; return;
/* in fullstack kill all enters */
if (win->ws->cur_layout->flags & SWM_L_FOCUSPREV)
return;
focus_magic(win, SWM_F_TRANSIENT); focus_magic(win, SWM_F_TRANSIENT);
} }