From: Reginald Kennedy Date: Tue, 5 Jun 2012 15:52:38 +0000 (+0800) Subject: Fix input focus not being set in max_stack mode on new mapped windows. X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=b7d49e02ee41b99ff8d31282bdec7703e885fd2a;p=spectrwm.git Fix input focus not being set in max_stack mode on new mapped windows. ok marco --- diff --git a/spectrwm.c b/spectrwm.c index 4b1bcc8..b1fc3f0 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1489,7 +1489,7 @@ bar_update(void) if (stack_enabled) stack = r->ws->stacker; - snprintf(loc, sizeof loc, + snprintf(loc, sizeof loc, "%d:%d %s %s %s%s %s %s", x++, r->ws->idx + 1, stack, ws, s, cn, bar_ext, bar_vertext); @@ -6439,6 +6439,13 @@ mapnotify(XEvent *e) win = manage_window(ev->window); if (win) set_win_state(win, NormalState); + + /* + * focus_win can only set input focus on a mapped window. + * make sure the window really has focus since it is just being mapped. + */ + if (win->ws->focus == win) + focus_win(win); } void