X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=1e205629f17ef33e09bc5ebed37c7e7abacfa722;hb=cfe055c6fc663ae4f4ab2520ba076c2409552dac;hp=960c0eba3bc415a246c9f87c9177c9632119c6a2;hpb=d766c1e8d1880f50d937065737bac04ad80548f9;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 960c0eb..1e20562 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -3465,8 +3465,9 @@ switchws(struct swm_region *r, union arg *args) this_r->ws = new_ws; new_ws->r = this_r; - /* Set focus_pending before stacking. */ - if (focus_mode != SWM_FOCUS_FOLLOW) + /* Set focus_pending before stacking, if needed. */ + if (focus_mode != SWM_FOCUS_FOLLOW && (!new_ws->focus_pending || + validate_win(new_ws->focus_pending))) new_ws->focus_pending = get_region_focus(new_ws->r); stack();