From cfe055c6fc663ae4f4ab2520ba076c2409552dac Mon Sep 17 00:00:00 2001 From: Reginald Kennedy Date: Tue, 26 Mar 2013 09:55:40 +0800 Subject: [PATCH] Fix focus when switching to an inactive workspace with a new window. --- spectrwm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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(); -- 1.7.10.4