From 31d09450590aaf4369666a22adb20574e6c1ee54 Mon Sep 17 00:00:00 2001 From: Michael Grant Date: Mon, 10 Nov 2025 23:04:03 +0100 Subject: [PATCH] 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. --- window.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/window.c b/window.c index 9b10fa68..f7fe866c 100644 --- a/window.c +++ b/window.c @@ -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)