From 83e45343875bb39c5854abf2c88856a10375c7c2 Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 14 Jun 2026 20:37:57 +0000 Subject: [PATCH] Skip floating panes when working out the top or bottom cell. Fixes missing bottom status pane status line when floating panes exist. --- layout.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/layout.c b/layout.c index 28c66f1e..da98b590 100644 --- a/layout.c +++ b/layout.c @@ -292,15 +292,22 @@ layout_fix_offsets(struct window *w) static int layout_cell_is_top(struct window *w, struct layout_cell *lc) { - struct layout_cell *next; + struct layout_cell *next, *edge; while (lc != w->layout_root) { next = lc->parent; if (next == NULL) return (0); - if (next->type == LAYOUT_TOPBOTTOM && - lc != TAILQ_FIRST(&next->cells)) - return (0); + if (next->type == LAYOUT_TOPBOTTOM) { + edge = TAILQ_FIRST(&next->cells); + while (edge != NULL) { + if (~edge->flags & LAYOUT_CELL_FLOATING) + break; + edge = TAILQ_NEXT(edge, entry); + } + if (lc != edge) + return (0); + } lc = next; } return (1); @@ -310,15 +317,22 @@ layout_cell_is_top(struct window *w, struct layout_cell *lc) static int layout_cell_is_bottom(struct window *w, struct layout_cell *lc) { - struct layout_cell *next; + struct layout_cell *next, *edge; while (lc != w->layout_root) { next = lc->parent; if (next == NULL) return (0); - if (next->type == LAYOUT_TOPBOTTOM && - lc != TAILQ_LAST(&next->cells, layout_cells)) - return (0); + if (next->type == LAYOUT_TOPBOTTOM) { + edge = TAILQ_LAST(&next->cells, layout_cells); + while (edge != NULL) { + if (~edge->flags & LAYOUT_CELL_FLOATING) + break; + edge = TAILQ_PREV(edge, layout_cells, entry); + } + if (lc != edge) + return (0); + } lc = next; } return (1);