diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-11-24 14:38:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2016-11-24 14:38:56 +0000 |
commit | 51a9f5c40c4a1ba13c7c23a449447ababb26a21b (patch) | |
tree | 2f4e5e1d8ae959269a9a13d75268490f95c5f50a /usr.bin/tmux/server-client.c | |
parent | 72eb538f0e2b28e1febaea9efac13e654cc8e990 (diff) |
If in the middle of a drag, don't use an invalid key, just use
KEYC_MOUSE as a placeholder. Reported by Artem Fokin.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r-- | usr.bin/tmux/server-client.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index e57f0b1a78b..cc4fd2dba20 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.202 2016/11/24 13:46:50 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.203 2016/11/24 14:38:55 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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; |