aboutsummaryrefslogtreecommitdiff
path: root/layout.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2021-03-11 08:01:29 +0000
committerThomas Adam <thomas@xteddy.org>2021-03-11 08:01:29 +0000
commit12cfd0d22b630ead9c6d739b13c3409485ea551c (patch)
treeee2535b2b0e0075078cae6a2eb0bf5171d11078d /layout.c
parent541872bc5754a8f4daa84f23043c356f7ac4f663 (diff)
parentee0df1b8f8a9099fbd67a73c9fb20b89c64d6106 (diff)
downloadrtmux-12cfd0d22b630ead9c6d739b13c3409485ea551c.tar.gz
rtmux-12cfd0d22b630ead9c6d739b13c3409485ea551c.tar.bz2
rtmux-12cfd0d22b630ead9c6d739b13c3409485ea551c.zip
Merge branch 'obsd-master' into master
Diffstat (limited to 'layout.c')
-rw-r--r--layout.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/layout.c b/layout.c
index 37214d02..04a13b0c 100644
--- a/layout.c
+++ b/layout.c
@@ -286,7 +286,7 @@ layout_add_border(struct window *w, struct layout_cell *lc, int status)
/* Update pane offsets and sizes based on their cells. */
void
-layout_fix_panes(struct window *w)
+layout_fix_panes(struct window *w, struct window_pane *skip)
{
struct window_pane *wp;
struct layout_cell *lc;
@@ -294,7 +294,7 @@ layout_fix_panes(struct window *w)
status = options_get_number(w->options, "pane-border-status");
TAILQ_FOREACH(wp, &w->panes, entry) {
- if ((lc = wp->layout_cell) == NULL)
+ if ((lc = wp->layout_cell) == NULL || wp == skip)
continue;
wp->xoff = lc->xoff;
@@ -482,7 +482,7 @@ layout_init(struct window *w, struct window_pane *wp)
lc = w->layout_root = layout_create_cell(NULL);
layout_set_size(lc, w->sx, w->sy, 0, 0);
layout_make_leaf(lc, wp);
- layout_fix_panes(w);
+ layout_fix_panes(w, NULL);
}
void
@@ -540,7 +540,7 @@ layout_resize(struct window *w, u_int sx, u_int sy)
/* Fix cell offsets. */
layout_fix_offsets(w);
- layout_fix_panes(w);
+ layout_fix_panes(w, NULL);
}
/* Resize a pane to an absolute size. */
@@ -600,7 +600,7 @@ layout_resize_layout(struct window *w, struct layout_cell *lc,
/* Fix cell offsets. */
layout_fix_offsets(w);
- layout_fix_panes(w);
+ layout_fix_panes(w, NULL);
notify_window("window-layout-changed", w);
}
@@ -704,10 +704,14 @@ layout_resize_pane_shrink(struct window *w, struct layout_cell *lc,
/* Assign window pane to newly split cell. */
void
-layout_assign_pane(struct layout_cell *lc, struct window_pane *wp)
+layout_assign_pane(struct layout_cell *lc, struct window_pane *wp,
+ int do_not_resize)
{
layout_make_leaf(lc, wp);
- layout_fix_panes(wp->window);
+ if (do_not_resize)
+ layout_fix_panes(wp->window, wp);
+ else
+ layout_fix_panes(wp->window, NULL);
}
/* Calculate the new pane size for resized parent. */
@@ -1040,7 +1044,7 @@ layout_close_pane(struct window_pane *wp)
/* Fix pane offsets and sizes. */
if (w->layout_root != NULL) {
layout_fix_offsets(w);
- layout_fix_panes(w);
+ layout_fix_panes(w, NULL);
}
notify_window("window-layout-changed", w);
}
@@ -1109,7 +1113,7 @@ layout_spread_out(struct window_pane *wp)
do {
if (layout_spread_cell(w, parent)) {
layout_fix_offsets(w);
- layout_fix_panes(w);
+ layout_fix_panes(w, NULL);
break;
}
} while ((parent = parent->parent) != NULL);