aboutsummaryrefslogtreecommitdiff
path: root/server-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c
index 7381eb52..ae41278a 100644
--- a/server-client.c
+++ b/server-client.c
@@ -1239,6 +1239,8 @@ server_client_loop(void)
struct client *c;
struct window *w;
struct window_pane *wp;
+ struct winlink *wl;
+ struct session *s;
int focus;
TAILQ_FOREACH(c, &clients, entry) {
@@ -1255,8 +1257,13 @@ server_client_loop(void)
*/
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 (wp->fd != -1) {
+ if (wl != NULL && wp->fd != -1) {
if (focus)
server_client_check_focus(wp);
server_client_check_resize(wp);
@@ -1521,7 +1528,9 @@ server_client_click_timer(__unused int fd, __unused short events, void *data)
static void
server_client_check_exit(struct client *c)
{
- if (!(c->flags & CLIENT_EXIT))
+ if (~c->flags & CLIENT_EXIT)
+ return;
+ if (c->flags & CLIENT_EXITED)
return;
if (EVBUFFER_LENGTH(c->stdin_data) != 0)
@@ -1534,7 +1543,7 @@ server_client_check_exit(struct client *c)
if (c->flags & CLIENT_ATTACHED)
notify_client("client-detached", c);
proc_send(c->peer, MSG_EXIT, -1, &c->retval, sizeof c->retval);
- c->flags &= ~CLIENT_EXIT;
+ c->flags |= CLIENT_EXITED;
}
/* Redraw timer callback. */