summaryrefslogtreecommitdiffstats
path: root/cmd.c
diff options
context:
space:
mode:
authornicm <nicm>2019-05-03 16:51:29 +0000
committernicm <nicm>2019-05-03 16:51:29 +0000
commitfc3d85e34bf323762ac000b44bfd4a6b33aad37c (patch)
tree8276d8c86d81f35e13196fdae560b30c805c83dd /cmd.c
parentcf6075fb29fcd86f11a1f2cc6e906c62f39d4032 (diff)
Fix mouse positioning when the pane is not entirely visible.
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd.c b/cmd.c
index 8ed6596c..57b3350c 100644
--- a/cmd.c
+++ b/cmd.c
@@ -481,17 +481,16 @@ cmd_mouse_at(struct window_pane *wp, struct mouse_event *m, u_int *xp,
u_int x, y;
if (last) {
- x = m->lx;
- y = m->ly;
+ x = m->lx + m->ox;
+ y = m->ly + m->oy;
} else {
x = m->x;
y = m->y;
}
+ log_debug("%s: x=%u, y=%u%s", __func__, x, y, last ? " (last)" : "");
if (m->statusat == 0 && y > 0)
y--;
- else if (m->statusat > 0 && y >= (u_int)m->statusat)
- y = m->statusat - 1;
if (x < wp->xoff || x >= wp->xoff + wp->sx)
return (-1);