aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2016-11-24 14:38:55 +0000
committernicm <nicm>2016-11-24 14:38:55 +0000
commit84319aa8f013238ccc1bbd6ea44b9e6be7c58db2 (patch)
tree772bc179ee93be321d24b1952fe65935a63f5146
parent0d1be2e32838cfb4f4b528fc3f94ef850b47eda7 (diff)
downloadrtmux-84319aa8f013238ccc1bbd6ea44b9e6be7c58db2.tar.gz
rtmux-84319aa8f013238ccc1bbd6ea44b9e6be7c58db2.tar.bz2
rtmux-84319aa8f013238ccc1bbd6ea44b9e6be7c58db2.zip
If in the middle of a drag, don't use an invalid key, just use
KEYC_MOUSE as a placeholder. Reported by Artem Fokin.
-rw-r--r--server-client.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/server-client.c b/server-client.c
index dd2a274a..ff43f73d 100644
--- a/server-client.c
+++ b/server-client.c
@@ -474,9 +474,10 @@ have_event:
case NOTYPE:
break;
case DRAG:
- if (c->tty.mouse_drag_update != NULL)
+ if (c->tty.mouse_drag_update != NULL) {
c->tty.mouse_drag_update(c, m);
- else {
+ key = KEYC_MOUSE;
+ } else {
switch (MOUSE_BUTTONS(b)) {
case 0:
if (where == PANE)
@@ -738,6 +739,13 @@ server_client_handle_key(struct client *c, key_code key)
m->valid = 1;
m->key = key;
+
+ /*
+ * A mouse event that continues to be valid but that we do not
+ * want to pass through.
+ */
+ if (key == KEYC_MOUSE)
+ return;
} else
m->valid = 0;