diff options
author | 2019-05-03 16:51:29 +0000 | |
---|---|---|
committer | 2019-05-03 16:51:29 +0000 | |
commit | c7de2738b47f968373f10bc073bf1a2a2c84f6e8 (patch) | |
tree | 0d1fddce2fc0295119336567b673eee946fd751c /usr.bin/tmux/cmd.c | |
parent | Fixed endless loop/ OOB write on 64 bit systems with large buffers. (diff) | |
download | wireguard-openbsd-c7de2738b47f968373f10bc073bf1a2a2c84f6e8.tar.xz wireguard-openbsd-c7de2738b47f968373f10bc073bf1a2a2c84f6e8.zip |
Fix mouse positioning when the pane is not entirely visible.
Diffstat (limited to 'usr.bin/tmux/cmd.c')
-rw-r--r-- | usr.bin/tmux/cmd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd.c b/usr.bin/tmux/cmd.c index 335279c5aa9..8dcc9103acd 100644 --- a/usr.bin/tmux/cmd.c +++ b/usr.bin/tmux/cmd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd.c,v 1.144 2019/04/25 19:36:59 nicm Exp $ */ +/* $OpenBSD: cmd.c,v 1.145 2019/05/03 16:51:29 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -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); |