summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-05-09 14:09:32 +0000
committernicm <nicm@openbsd.org>2019-05-09 14:09:32 +0000
commitbdacbbee81a694599e23157084603bb68b1cc03b (patch)
tree921f7bb3771f52bfd366ac8e742f76d1644edf33
parentdisable stack printing for now since at least arm64 can't print them (diff)
downloadwireguard-openbsd-bdacbbee81a694599e23157084603bb68b1cc03b.tar.xz
wireguard-openbsd-bdacbbee81a694599e23157084603bb68b1cc03b.zip
Save mouse buttons as well as position.
-rw-r--r--usr.bin/tmux/tmux.h3
-rw-r--r--usr.bin/tmux/tty-keys.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 98d1e0e66c1..05b75f6ecff 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.892 2019/05/09 13:12:59 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.893 2019/05/09 14:09:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -1168,6 +1168,7 @@ struct tty {
u_int mouse_last_x;
u_int mouse_last_y;
+ u_int mouse_last_b;
int mouse_drag_flag;
void (*mouse_drag_update)(struct client *,
struct mouse_event *);
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index e8aef1b5d71..696c31a29aa 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.113 2019/05/07 11:24:03 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.114 2019/05/09 14:09:32 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -893,7 +893,7 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size,
m->x = x;
m->ly = tty->mouse_last_y;
m->y = y;
- m->lb = m->b;
+ m->lb = tty->mouse_last_b;
m->b = b;
m->sgr_type = sgr_type;
m->sgr_b = sgr_b;
@@ -901,6 +901,7 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size,
/* Update last mouse state. */
tty->mouse_last_x = x;
tty->mouse_last_y = y;
+ tty->mouse_last_b = b;
return (0);
}