summaryrefslogtreecommitdiffstats
path: root/server-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-09-11 09:21:16 +0100
committerThomas Adam <thomas@xteddy.org>2018-09-11 09:21:16 +0100
commit5e36d52651acced3bb1953cf4c0a80b1bc4a13fc (patch)
treef264623cf249cbd5cefa16f935796b13255c890d /server-client.c
parent9b32758a0c810e17bd0537a136c0204b2defcabd (diff)
parentbd9133b31d1a66d2ea1c6dd893dcd35903a306b9 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'server-client.c')
-rw-r--r--server-client.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/server-client.c b/server-client.c
index ece16a42..7bdd57e3 100644
--- a/server-client.c
+++ b/server-client.c
@@ -535,26 +535,32 @@ have_event:
m->x = x + m->ox;
m->y = y + m->oy;
- TAILQ_FOREACH(wp, &s->curw->window->panes, entry) {
- if ((wp->xoff + wp->sx == px &&
- wp->yoff <= 1 + py &&
- wp->yoff + wp->sy >= py) ||
- (wp->yoff + wp->sy == py &&
- wp->xoff <= 1 + px &&
- wp->xoff + wp->sx >= px))
- 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 {
- wp = window_get_active_at(s->curw->window, px, py);
+
+ /* Otherwise try inside the pane. */
+ if (where == NOWHERE) {
+ wp = window_get_active_at(s->curw->window, x, y);
if (wp != NULL)
where = PANE;
}
+
if (where == NOWHERE)
return (KEYC_UNKNOWN);
if (where == PANE)
- log_debug("mouse %u,%u on pane %%%u", px, py, wp->id);
+ 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;