Do not check for mouse events on pane borders when zoomed, based on a

fix from Avi Halachmi.
This commit is contained in:
nicm 2018-09-11 06:37:54 +00:00
parent 1b92afa799
commit bd9133b31d

View File

@ -523,6 +523,8 @@ have_event:
else if (m->statusat > 0 && y >= (u_int)m->statusat) else if (m->statusat > 0 && y >= (u_int)m->statusat)
y = m->statusat - 1; y = m->statusat - 1;
/* Try the pane borders if not zoomed. */
if (~s->curw->window->flags & WINDOW_ZOOMED) {
TAILQ_FOREACH(wp, &s->curw->window->panes, entry) { TAILQ_FOREACH(wp, &s->curw->window->panes, entry) {
if ((wp->xoff + wp->sx == x && if ((wp->xoff + wp->sx == x &&
wp->yoff <= 1 + y && wp->yoff <= 1 + y &&
@ -534,16 +536,21 @@ have_event:
} }
if (wp != NULL) if (wp != NULL)
where = BORDER; where = BORDER;
else { }
/* Otherwise try inside the pane. */
if (where == NOWHERE) {
wp = window_get_active_at(s->curw->window, x, y); wp = window_get_active_at(s->curw->window, x, y);
if (wp != NULL) { if (wp != NULL)
where = PANE; where = PANE;
log_debug("mouse at %u,%u is on pane %%%u",
x, y, wp->id);
}
} }
if (where == NOWHERE) if (where == NOWHERE)
return (KEYC_UNKNOWN); 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->wp = wp->id;
m->w = wp->window->id; m->w = wp->window->id;
} else } else