summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2024-04-10 07:29:16 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2024-04-10 07:29:16 +0000
commitcdfbf616ddc7bf05f186259d254957a3310d5bd6 (patch)
treea198874a019c4879d424939e17794e056873bc2d /usr.bin/tmux
parent58eb9d37a482d34af43829c28e51af6161bd4c2c (diff)
Correct handling of mouse up events (don't ignore all but the last
released button), and always process down event for double click. From Rudy Dellomas III in GitHub issue 3919.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 01e3bd1ac6b..6ed62c49bec 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.404 2024/01/16 13:09:11 claudio Exp $ */
+/* $OpenBSD: server-client.c,v 1.405 2024/04/10 07:29:15 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -626,6 +626,8 @@ server_client_check_mouse(struct client *c, struct key_event *event)
} else if (MOUSE_RELEASE(m->b)) {
type = UP;
x = m->x, y = m->y, b = m->lb;
+ if (m->sgr_type == 'm')
+ b = m->sgr_b;
log_debug("up at %u,%u", x, y);
} else {
if (c->flags & CLIENT_DOUBLECLICK) {
@@ -646,7 +648,10 @@ server_client_check_mouse(struct client *c, struct key_event *event)
log_debug("triple-click at %u,%u", x, y);
goto have_event;
}
- } else {
+ }
+
+ /* DOWN is the only remaining event type. */
+ if (type == NOTYPE) {
type = DOWN;
x = m->x, y = m->y, b = m->b;
log_debug("down at %u,%u", x, y);