version 1.271, 2019/03/16 17:14:07 |
version 1.272, 2019/03/18 20:53:33 |
|
|
{ |
{ |
struct session *s = c->session; |
struct session *s = c->session; |
struct mouse_event *m = &c->tty.mouse; |
struct mouse_event *m = &c->tty.mouse; |
struct window *w; |
struct winlink *wl; |
struct window_pane *wp; |
struct window_pane *wp; |
u_int x, y, b, sx, sy, px, py; |
u_int x, y, b, sx, sy, px, py; |
int flag; |
int flag; |
key_code key; |
key_code key; |
struct timeval tv; |
struct timeval tv; |
|
struct style_range *sr; |
enum { NOTYPE, MOVE, DOWN, UP, DRAG, WHEEL, DOUBLE, TRIPLE } type; |
enum { NOTYPE, MOVE, DOWN, UP, DRAG, WHEEL, DOUBLE, TRIPLE } type; |
enum { NOWHERE, PANE, STATUS, STATUS_LEFT, STATUS_RIGHT, BORDER } where; |
enum { NOWHERE, PANE, STATUS, STATUS_LEFT, STATUS_RIGHT, BORDER } where; |
|
|
|
|
|
|
/* Is this on the status line? */ |
/* Is this on the status line? */ |
m->statusat = status_at_line(c); |
m->statusat = status_at_line(c); |
if (m->statusat != -1 && y == (u_int)m->statusat) { |
if (m->statusat != -1 && |
if (x < c->status.left_size) |
y >= (u_int)m->statusat && |
|
y < m->statusat + status_line_size(c)) |
|
sr = status_get_range(c, x, y - m->statusat); |
|
else |
|
sr = NULL; |
|
if (sr != NULL) { |
|
switch (sr->type) { |
|
case STYLE_RANGE_NONE: |
|
break; |
|
case STYLE_RANGE_LEFT: |
where = STATUS_LEFT; |
where = STATUS_LEFT; |
else if (x > c->tty.sx - c->status.right_size) |
break; |
|
case STYLE_RANGE_RIGHT: |
where = STATUS_RIGHT; |
where = STATUS_RIGHT; |
else { |
break; |
w = status_get_window_at(c, x); |
case STYLE_RANGE_WINDOW: |
if (w == NULL) |
wl = winlink_find_by_index(&s->windows, sr->argument); |
return (KEYC_UNKNOWN); |
if (wl != NULL) { |
m->w = w->id; |
m->w = wl->window->id; |
where = STATUS; |
where = STATUS; |
|
} |
|
break; |
} |
} |
} |
} |
|
|