Merge branch 'master' into floating_panes

This commit is contained in:
Dane Jensen
2026-06-15 13:00:51 -07:00
12 changed files with 281 additions and 104 deletions

View File

@@ -686,11 +686,18 @@ window_get_active_at(struct window *w, u_int x, u_int y)
continue;
}
} else {
/* Floating - include all borders. */
if ((int)x < xoff - 1 || x > xoff + sx)
continue;
if ((int)y < yoff - 1 || y > yoff + sy)
continue;
if (window_pane_get_pane_lines(wp) == PANE_LINES_NONE) {
if ((int)x < xoff || (int)x >= xoff + (int)sx)
continue;
if ((int)y < yoff || (int)y >= yoff + (int)sy)
continue;
} else {
/* Floating - include all borders. */
if ((int)x < xoff - 1 || x > xoff + sx)
continue;
if ((int)y < yoff - 1 || y > yoff + sy)
continue;
}
}
return (wp);
}
@@ -2168,16 +2175,14 @@ struct style_range *
window_pane_status_get_range(struct window_pane *wp, u_int x, u_int y)
{
struct style_ranges *srs;
struct window *w;
u_int line;
int pane_status;
if (wp == NULL)
return (NULL);
w = wp->window;
srs = &wp->border_status_line.ranges;
pane_status = window_get_pane_status(w);
pane_status = window_pane_get_pane_status(wp);
if (pane_status == PANE_STATUS_TOP)
line = wp->yoff - 1;
else if (pane_status == PANE_STATUS_BOTTOM)
@@ -2192,10 +2197,46 @@ window_pane_status_get_range(struct window_pane *wp, u_int x, u_int y)
return (style_ranges_get_range(srs, x - wp->xoff - 2));
}
enum pane_lines
window_pane_get_pane_lines(struct window_pane *wp)
{
struct options *oo;
if (!window_pane_is_floating(wp))
oo = wp->window->options;
else
oo = wp->options;
return (options_get_number(oo, "pane-border-lines"));
}
int
window_get_pane_status(struct window *w)
{
return (options_get_number(w->options, "pane-border-status"));
int status;
status = options_get_number(w->options, "pane-border-status");
if (status == PANE_STATUS_TOP_FLOATING ||
status == PANE_STATUS_BOTTOM_FLOATING)
return (PANE_STATUS_OFF);
return (status);
}
int
window_pane_get_pane_status(struct window_pane *wp)
{
int status;
if (!window_pane_is_floating(wp))
return (window_get_pane_status(wp->window));
if (window_pane_get_pane_lines(wp) == PANE_LINES_NONE)
return (PANE_STATUS_OFF);
status = options_get_number(wp->options, "pane-border-status");
if (status == PANE_STATUS_TOP_FLOATING)
return (PANE_STATUS_TOP);
if (status == PANE_STATUS_BOTTOM_FLOATING)
return (PANE_STATUS_BOTTOM);
return (status);
}
int