version 1.47, 2009/10/10 10:02:48 |
version 1.48, 2009/10/10 14:51:16 |
|
|
struct window *w; |
struct window *w; |
struct window_pane *wp; |
struct window_pane *wp; |
struct screen *s; |
struct screen *s; |
|
struct options *oo; |
struct timeval tv; |
struct timeval tv; |
struct key_binding *bd; |
struct key_binding *bd; |
struct keylist *keylist; |
struct keylist *keylist; |
|
|
c->session->activity = time(NULL); |
c->session->activity = time(NULL); |
w = c->session->curw->window; |
w = c->session->curw->window; |
wp = w->active; /* could die */ |
wp = w->active; /* could die */ |
|
oo = &c->session->options; |
|
|
/* Special case: number keys jump to pane in identify mode. */ |
/* Special case: number keys jump to pane in identify mode. */ |
if (c->flags & CLIENT_IDENTIFY && key >= '0' && key <= '9') { |
if (c->flags & CLIENT_IDENTIFY && key >= '0' && key <= '9') { |
|
|
|
|
/* Check for mouse keys. */ |
/* Check for mouse keys. */ |
if (key == KEYC_MOUSE) { |
if (key == KEYC_MOUSE) { |
|
if (options_get_number(oo, "mouse-select-pane")) { |
|
window_set_active_at(w, mouse[1], mouse[2]); |
|
wp = w->active; |
|
} |
window_pane_mouse(wp, c, mouse[0], mouse[1], mouse[2]); |
window_pane_mouse(wp, c, mouse[0], mouse[1], mouse[2]); |
continue; |
continue; |
} |
} |
|
|
} |
} |
if (c->session == NULL) |
if (c->session == NULL) |
return; |
return; |
wp = c->session->curw->window->active; /* could die - do each loop */ |
w = c->session->curw->window; |
|
wp = w->active; |
|
oo = &c->session->options; |
s = wp->screen; |
s = wp->screen; |
|
|
/* |
/* |
|
|
* tty_region/tty_reset/tty_update_mode already take care of not |
* tty_region/tty_reset/tty_update_mode already take care of not |
* resetting things that are already in their default state. |
* resetting things that are already in their default state. |
*/ |
*/ |
status = options_get_number(&c->session->options, "status"); |
status = options_get_number(oo, "status"); |
tty_region(&c->tty, 0, c->tty.sy - 1, 0); |
tty_region(&c->tty, 0, c->tty.sy - 1, 0); |
if (!window_pane_visible(wp) || wp->yoff + s->cy >= c->tty.sy - status) |
if (!window_pane_visible(wp) || wp->yoff + s->cy >= c->tty.sy - status) |
tty_cursor(&c->tty, 0, 0, 0, 0); |
tty_cursor(&c->tty, 0, 0, 0, 0); |
|
|
tty_cursor(&c->tty, s->cx, s->cy, wp->xoff, wp->yoff); |
tty_cursor(&c->tty, s->cx, s->cy, wp->xoff, wp->yoff); |
|
|
mode = s->mode; |
mode = s->mode; |
|
if (TAILQ_NEXT(TAILQ_FIRST(&w->panes), entry) != NULL && |
|
options_get_number(oo, "mouse-select-pane")) |
|
mode |= MODE_MOUSE; |
tty_update_mode(&c->tty, mode); |
tty_update_mode(&c->tty, mode); |
tty_reset(&c->tty); |
tty_reset(&c->tty); |
} |
} |