summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2013-10-10 11:57:52 +0000
committernicm <nicm>2013-10-10 11:57:52 +0000
commit784b711393f99523482515d7e6d0114f96f2ecec (patch)
treeb9a31f005c2f4192b6bc62d9188849be74626084
parent81a548bcc4bf4e85935ce8ee65217b41d094d990 (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.
-rw-r--r--tty-keys.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tty-keys.c b/tty-keys.c
index 3b652db8..7de5ce59 100644
--- a/tty-keys.c
+++ b/tty-keys.c
@@ -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);
}