Prohibit swapping 2 floating panes, that doesn't make sense.

This commit is contained in:
Michael Grant
2026-03-20 07:59:25 +00:00
parent 943490cfa1
commit 10a9ce1ed2
2 changed files with 16 additions and 0 deletions

View File

@@ -301,6 +301,8 @@ layout_cell_is_top(struct window *w, struct layout_cell *lc)
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);
@@ -317,6 +319,8 @@ layout_cell_is_bottom(struct window *w, struct layout_cell *lc)
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);