summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2018-09-11 06:37:55 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2018-09-11 06:37:55 +0000
commit02863211373b01524e3d0255c7ca9cde7b0e339f (patch)
treeb9f35dd6f95de7cd251a84f08cd1fb79ee972e58 /usr.bin/tmux
parentdb328120e4815f8bf130c7633789ba6ad0fcd308 (diff)
Do not check for mouse events on pane borders when zoomed, based on a
fix from Avi Halachmi.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index bd1bea079b7..8bc546f7507 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.259 2018/08/29 09:50:32 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.260 2018/09/11 06:37:54 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -523,27 +523,34 @@ have_event:
else if (m->statusat > 0 && y >= (u_int)m->statusat)
y = m->statusat - 1;
- TAILQ_FOREACH(wp, &s->curw->window->panes, entry) {
- if ((wp->xoff + wp->sx == x &&
- wp->yoff <= 1 + y &&
- wp->yoff + wp->sy >= y) ||
- (wp->yoff + wp->sy == y &&
- wp->xoff <= 1 + x &&
- wp->xoff + wp->sx >= x))
- break;
+ /* Try the pane borders if not zoomed. */
+ if (~s->curw->window->flags & WINDOW_ZOOMED) {
+ TAILQ_FOREACH(wp, &s->curw->window->panes, entry) {
+ if ((wp->xoff + wp->sx == x &&
+ wp->yoff <= 1 + y &&
+ wp->yoff + wp->sy >= y) ||
+ (wp->yoff + wp->sy == y &&
+ wp->xoff <= 1 + x &&
+ wp->xoff + wp->sx >= x))
+ break;
+ }
+ if (wp != NULL)
+ where = BORDER;
}
- if (wp != NULL)
- where = BORDER;
- else {
+
+ /* Otherwise try inside the pane. */
+ if (where == NOWHERE) {
wp = window_get_active_at(s->curw->window, x, y);
- if (wp != NULL) {
+ if (wp != NULL)
where = PANE;
- log_debug("mouse at %u,%u is on pane %%%u",
- x, y, wp->id);
- }
}
+
if (where == NOWHERE)
return (KEYC_UNKNOWN);
+ if (where == PANE)
+ log_debug("mouse %u,%u on pane %%%u", x, y, wp->id);
+ else if (where == BORDER)
+ log_debug("mouse on pane %%%u border", wp->id);
m->wp = wp->id;
m->w = wp->window->id;
} else