summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2024-04-10 07:29:15 +0000
committernicm <nicm>2024-04-10 07:29:15 +0000
commitc62a9ca16b8fa199904c7628f0cb95c50593af6f (patch)
treeb79faa5cfee046b32e562e1ec3d105ba945808b2
parent424f13fe13036e75b1c80e7751b81529f4cd8e15 (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.
-rw-r--r--server-client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c
index 5680594a..15f8e890 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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);