aboutsummaryrefslogtreecommitdiff
path: root/input-keys.c
diff options
context:
space:
mode:
authornicm <nicm>2020-03-16 06:12:42 +0000
committernicm <nicm>2020-03-16 06:12:42 +0000
commitd162ff48f3069c8371a40ddbcf987946dbddf953 (patch)
treec629a100e1c8f374ed1f0e7c9a8d97f06e7b1f22 /input-keys.c
parent882d0b785d52843b76a387ff3c6bf2cae46fc7ec (diff)
downloadrtmux-d162ff48f3069c8371a40ddbcf987946dbddf953.tar.gz
rtmux-d162ff48f3069c8371a40ddbcf987946dbddf953.tar.bz2
rtmux-d162ff48f3069c8371a40ddbcf987946dbddf953.zip
Send mouse down event immediately rather than waiting for double click
to finish which would now mean it was out of order. Reported by Mark Kelly.
Diffstat (limited to 'input-keys.c')
-rw-r--r--input-keys.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/input-keys.c b/input-keys.c
index 5c7e8b1f..d09bf8fb 100644
--- a/input-keys.c
+++ b/input-keys.c
@@ -254,12 +254,12 @@ static void
input_key_mouse(struct window_pane *wp, struct mouse_event *m)
{
struct screen *s = wp->screen;
- int mode = s->mode;
char buf[40];
size_t len;
u_int x, y;
- if ((mode & ALL_MOUSE_MODES) == 0)
+ /* Ignore events if no mouse mode or the pane is not visible. */
+ if (m->ignore || (s->mode & ALL_MOUSE_MODES) == 0)
return;
if (cmd_mouse_at(wp, m, &x, &y, 0) != 0)
return;
@@ -267,8 +267,7 @@ input_key_mouse(struct window_pane *wp, struct mouse_event *m)
return;
/* If this pane is not in button or all mode, discard motion events. */
- if (MOUSE_DRAG(m->b) &&
- (mode & (MODE_MOUSE_BUTTON|MODE_MOUSE_ALL)) == 0)
+ if (MOUSE_DRAG(m->b) && (s->mode & MOTION_MOUSE_MODES) == 0)
return;
/*
@@ -280,13 +279,13 @@ input_key_mouse(struct window_pane *wp, struct mouse_event *m)
if (m->sgr_type != ' ') {
if (MOUSE_DRAG(m->sgr_b) &&
MOUSE_BUTTONS(m->sgr_b) == 3 &&
- (~mode & MODE_MOUSE_ALL))
+ (~s->mode & MODE_MOUSE_ALL))
return;
} else {
if (MOUSE_DRAG(m->b) &&
MOUSE_BUTTONS(m->b) == 3 &&
MOUSE_BUTTONS(m->lb) == 3 &&
- (~mode & MODE_MOUSE_ALL))
+ (~s->mode & MODE_MOUSE_ALL))
return;
}