Move the PANE_FLOATING flag into the layout cell and add an accessor.

From Dane Jensen.
This commit is contained in:
nicm
2026-06-02 08:13:50 +00:00
parent 35f4c8b333
commit ae6a749d3a
14 changed files with 69 additions and 52 deletions

View File

@@ -79,8 +79,8 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
if (src_wp == dst_wp)
goto out;
if ((src_wp->flags & PANE_FLOATING) &&
(dst_wp->flags & PANE_FLOATING)) {
if (window_pane_is_floating(src_wp) &&
window_pane_is_floating(dst_wp)) {
cmdq_error(item, "cannot swap floating panes");
return (CMD_RETURN_ERROR);
}
@@ -114,9 +114,9 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
dst_wp->layout_cell = src_lc;
dst_lc->wp = src_wp;
src_wp->layout_cell = dst_lc;
if ((src_wp->flags ^ dst_wp->flags) & PANE_FLOATING) {
src_wp->flags ^= PANE_FLOATING;
dst_wp->flags ^= PANE_FLOATING;
if (window_pane_is_floating(src_wp) != window_pane_is_floating(dst_wp)) {
src_wp->layout_cell->flags ^= LAYOUT_CELL_FLOATING;
dst_wp->layout_cell->flags ^= LAYOUT_CELL_FLOATING;
}
src_wp->window = dst_w;