aboutsummaryrefslogtreecommitdiff
path: root/server-client.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 /server-client.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 'server-client.c')
-rw-r--r--server-client.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/server-client.c b/server-client.c
index 5e6c6947..02113386 100644
--- a/server-client.c
+++ b/server-client.c
@@ -419,6 +419,7 @@ server_client_check_mouse(struct client *c, struct key_event *event)
struct winlink *wl;
struct window_pane *wp;
u_int x, y, b, sx, sy, px, py;
+ int ignore = 0;
key_code key;
struct timeval tv;
struct style_range *sr;
@@ -445,6 +446,7 @@ server_client_check_mouse(struct client *c, struct key_event *event)
if (event->key == KEYC_DOUBLECLICK) {
type = DOUBLE;
x = m->x, y = m->y, b = m->b;
+ ignore = 1;
log_debug("double-click at %u,%u", x, y);
} else if ((m->sgr_type != ' ' &&
MOUSE_DRAG(m->sgr_b) &&
@@ -491,16 +493,17 @@ server_client_check_mouse(struct client *c, struct key_event *event)
type = TRIPLE;
x = m->x, y = m->y, b = m->b;
log_debug("triple-click at %u,%u", x, y);
+ ignore = 1;
goto have_event;
}
- }
+ } else
+ c->flags |= CLIENT_DOUBLECLICK;
+ add_timer:
type = DOWN;
x = m->x, y = m->y, b = m->b;
log_debug("down at %u,%u", x, y);
- c->flags |= CLIENT_DOUBLECLICK;
- add_timer:
if (KEYC_CLICK_TIMEOUT != 0) {
memcpy(&c->click_event, m, sizeof c->click_event);
c->click_button = m->b;
@@ -519,6 +522,7 @@ have_event:
/* Save the session. */
m->s = s->id;
m->w = -1;
+ m->ignore = ignore;
/* Is this on the status line? */
m->statusat = status_at_line(c);