summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authornicm <nicm>2018-09-11 06:37:54 +0000
committernicm <nicm>2018-09-11 06:37:54 +0000
commitbd9133b31d1a66d2ea1c6dd893dcd35903a306b9 (patch)
tree002395c8116f91650ca6907cc1ad21fdf4d37cf8 /server-client.c
parent1b92afa799a1b4f67fe098a3cae53e1d9869500e (diff)
Do not check for mouse events on pane borders when zoomed, based on a
fix from Avi Halachmi.
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/server-client.c b/server-client.c
index 32b51c50..afc390c7 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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