=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.92 retrieving revision 1.93 diff -c -r1.92 -r1.93 *** src/usr.bin/tmux/server-client.c 2013/03/24 09:25:04 1.92 --- src/usr.bin/tmux/server-client.c 2013/03/24 09:28:59 1.93 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.92 2013/03/24 09:25:04 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.93 2013/03/24 09:28:59 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 97,102 **** --- 97,104 ---- c->tty.mouse.event = MOUSE_EVENT_UP; c->tty.mouse.flags = 0; + c->flags |= CLIENT_FOCUSED; + evtimer_set(&c->repeat_timer, server_client_repeat_timer, c); for (i = 0; i < ARRAY_LENGTH(&clients); i++) { *************** *** 547,553 **** void server_client_check_focus(struct window_pane *wp) { ! struct session *s; /* If we don't care about focus, forget it. */ if (!(wp->base.mode & MODE_FOCUSON)) --- 549,556 ---- void server_client_check_focus(struct window_pane *wp) { ! u_int i; ! struct client *c; /* If we don't care about focus, forget it. */ if (!(wp->base.mode & MODE_FOCUSON)) *************** *** 562,574 **** goto not_focused; /* ! * If our window is the current window in any attached sessions, we're ! * focused. */ ! RB_FOREACH(s, sessions, &sessions) { ! if (s->flags & SESSION_UNATTACHED) continue; ! if (s->curw->window == wp->window) goto focused; } --- 565,584 ---- goto not_focused; /* ! * If our window is the current window in any focused clients with an ! * attached session, we're focused. */ ! for (i = 0; i < ARRAY_LENGTH(&clients); i++) { ! c = ARRAY_ITEM(&clients, i); ! if (c == NULL || c->session == NULL) continue; ! ! if (!(c->flags & CLIENT_FOCUSED)) ! continue; ! if (c->session->flags & SESSION_UNATTACHED) ! continue; ! ! if (c->session->curw->window == wp->window) goto focused; }