mirror of
https://github.com/tmux/tmux.git
synced 2026-06-20 17:25:57 +00:00
Fix mouse events on tiled pane status line - when panes share a border,
prefer the pane for which the border is the status line. With Dane Jensen.
This commit is contained in:
@@ -699,12 +699,8 @@ server_client_check_mouse_in_pane(struct window_pane *wp, int px, int py,
|
|||||||
bdr_bottom = fwp->yoff + fwp->sy;
|
bdr_bottom = fwp->yoff + fwp->sy;
|
||||||
if (py == bdr_bottom)
|
if (py == bdr_bottom)
|
||||||
break;
|
break;
|
||||||
if (window_pane_is_floating(wp)) {
|
if (py == bdr_top)
|
||||||
/* Floating pane, check top border. */
|
break;
|
||||||
bdr_top = fwp->yoff - 1;
|
|
||||||
if (py == bdr_top)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fwp != NULL)
|
if (fwp != NULL)
|
||||||
|
|||||||
22
window.c
22
window.c
@@ -621,12 +621,32 @@ window_get_active_at(struct window *w, u_int x, u_int y)
|
|||||||
|
|
||||||
pane_status = options_get_number(w->options, "pane-border-status");
|
pane_status = options_get_number(w->options, "pane-border-status");
|
||||||
|
|
||||||
|
if (pane_status == PANE_STATUS_TOP) {
|
||||||
|
/*
|
||||||
|
* Prefer a pane's top border status line over the pane above's
|
||||||
|
* bottom border.
|
||||||
|
*/
|
||||||
|
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
||||||
|
if (!window_pane_visible(wp) || window_pane_is_floating(wp))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy);
|
||||||
|
if ((int)x < xoff || x > xoff + sx)
|
||||||
|
continue;
|
||||||
|
if ((int)y == yoff - 1)
|
||||||
|
return (wp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
TAILQ_FOREACH(wp, &w->z_index, zentry) {
|
||||||
if (!window_pane_visible(wp))
|
if (!window_pane_visible(wp))
|
||||||
continue;
|
continue;
|
||||||
window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy);
|
window_pane_full_size_offset(wp, &xoff, &yoff, &sx, &sy);
|
||||||
if (!window_pane_is_floating(wp)) {
|
if (!window_pane_is_floating(wp)) {
|
||||||
/* Tiled - to and including bottom or right border. */
|
/*
|
||||||
|
* Tiled - to and including the right border, excluding
|
||||||
|
* the bottom border.
|
||||||
|
*/
|
||||||
if ((int)x < xoff || x > xoff + sx)
|
if ((int)x < xoff || x > xoff + sx)
|
||||||
continue;
|
continue;
|
||||||
if (pane_status == PANE_STATUS_TOP) {
|
if (pane_status == PANE_STATUS_TOP) {
|
||||||
|
|||||||
Reference in New Issue
Block a user