Fix dragging a window to y==0 when pane border status enabled. window_get_active_at() needs to return the pane at the top of the window when called with y==0, otherwise it returns null as if there is no pane at the top line.

This commit is contained in:
Michael Grant
2025-11-10 23:04:03 +01:00
parent 466e79d572
commit 31d0945059

View File

@@ -605,9 +605,11 @@ struct window_pane *
window_get_active_at(struct window *w, u_int x, u_int y)
{
struct window_pane *wp;
int xoff, yoff;
int status, xoff, yoff;
u_int sx, sy;
status = options_get_number(w->options, "pane-border-status");
TAILQ_FOREACH(wp, &w->z_index, zentry) {
if (!window_pane_visible(wp))
continue;
@@ -617,8 +619,13 @@ window_get_active_at(struct window *w, u_int x, u_int y)
right border. */
if ((int)x < xoff || x > xoff + sx)
continue;
if ((int)y < yoff || y > yoff + sy)
continue;
if (status == PANE_STATUS_TOP) {
if ((int)y < yoff - 1 || y > yoff + sy)
continue;
} else {
if ((int)y < yoff || y > yoff + sy)
continue;
}
} else {
/* Floating, include top or or left border. */
if ((int)x < xoff - 1 || x > xoff + sx)