=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.286 retrieving revision 1.287 diff -c -r1.286 -r1.287 *** src/usr.bin/tmux/server-client.c 2019/06/07 20:09:17 1.286 --- src/usr.bin/tmux/server-client.c 2019/06/11 13:09:00 1.287 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.286 2019/06/07 20:09:17 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.287 2019/06/11 13:09:00 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 1241,1246 **** --- 1241,1248 ---- struct client *c; struct window *w; struct window_pane *wp; + struct winlink *wl; + struct session *s; int focus; TAILQ_FOREACH(c, &clients, entry) { *************** *** 1257,1264 **** */ focus = options_get_number(global_options, "focus-events"); RB_FOREACH(w, windows, &windows) { TAILQ_FOREACH(wp, &w->panes, entry) { ! if (wp->fd != -1) { if (focus) server_client_check_focus(wp); server_client_check_resize(wp); --- 1259,1271 ---- */ focus = options_get_number(global_options, "focus-events"); RB_FOREACH(w, windows, &windows) { + TAILQ_FOREACH(wl, &w->winlinks, wentry) { + s = wl->session; + if (s->attached != 0 && s->curw == wl) + break; + } TAILQ_FOREACH(wp, &w->panes, entry) { ! if (wl != NULL && wp->fd != -1) { if (focus) server_client_check_focus(wp); server_client_check_resize(wp);