X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=b1fc3f01756df0632a5a7c50bec52a4fb7ba525f;hb=b7d49e02ee41b99ff8d31282bdec7703e885fd2a;hp=4b1bcc86d70597894dd83948f243547de7f72f1d;hpb=27902d3ddd20b3b2ce1442425d322b276287801a;p=spectrwm.git 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