version 1.92, 2013/03/24 09:25:04 |
version 1.93, 2013/03/24 09:28:59 |
|
|
c->tty.mouse.event = MOUSE_EVENT_UP; |
c->tty.mouse.event = MOUSE_EVENT_UP; |
c->tty.mouse.flags = 0; |
c->tty.mouse.flags = 0; |
|
|
|
c->flags |= CLIENT_FOCUSED; |
|
|
evtimer_set(&c->repeat_timer, server_client_repeat_timer, c); |
evtimer_set(&c->repeat_timer, server_client_repeat_timer, c); |
|
|
for (i = 0; i < ARRAY_LENGTH(&clients); i++) { |
for (i = 0; i < ARRAY_LENGTH(&clients); i++) { |
|
|
void |
void |
server_client_check_focus(struct window_pane *wp) |
server_client_check_focus(struct window_pane *wp) |
{ |
{ |
struct session *s; |
u_int i; |
|
struct client *c; |
|
|
/* If we don't care about focus, forget it. */ |
/* If we don't care about focus, forget it. */ |
if (!(wp->base.mode & MODE_FOCUSON)) |
if (!(wp->base.mode & MODE_FOCUSON)) |
|
|
goto not_focused; |
goto not_focused; |
|
|
/* |
/* |
* If our window is the current window in any attached sessions, we're |
* If our window is the current window in any focused clients with an |
* focused. |
* attached session, we're focused. |
*/ |
*/ |
RB_FOREACH(s, sessions, &sessions) { |
for (i = 0; i < ARRAY_LENGTH(&clients); i++) { |
if (s->flags & SESSION_UNATTACHED) |
c = ARRAY_ITEM(&clients, i); |
|
if (c == NULL || c->session == NULL) |
continue; |
continue; |
if (s->curw->window == wp->window) |
|
|
if (!(c->flags & CLIENT_FOCUSED)) |
|
continue; |
|
if (c->session->flags & SESSION_UNATTACHED) |
|
continue; |
|
|
|
if (c->session->curw->window == wp->window) |
goto focused; |
goto focused; |
} |
} |
|
|