diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 11:57:53 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 11:57:53 +0000 |
commit | bfc8f0fa1743a519f0e34a06d67adb79feff5bad (patch) | |
tree | 03884c4ea740a9baaf2d4c640c1d4fe19a0fbd58 /usr.bin/tmux | |
parent | 0a8cea6e9a66cb0b22a8497bf6c35844e478f83d (diff) |
Assign mouse x/y coords before checking them. When receiving mouse
inputs, we should set the x/y coordinates earlier than we currently do,
so that we aren't off-by-one in the case when the statusbar is at the
top of the screen. By Thomas Adam.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/tty-keys.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index f348c1aee16..f3adf16d380 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.60 2013/10/10 11:49:42 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.61 2013/10/10 11:57:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -746,6 +746,8 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size) m->sgr = sgr; m->sgr_xb = sgr_b; m->sgr_rel = sgr_rel; + m->x = x; + m->y = y; if (b & 64) { /* wheel button */ b &= 3; if (b == 0) @@ -773,8 +775,6 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size) } m->button = (b & 3); } - m->x = x; - m->y = y; return (0); } |