=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/layout.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -r1.47 -r1.48 --- src/usr.bin/tmux/layout.c 2019/07/15 18:43:32 1.47 +++ src/usr.bin/tmux/layout.c 2021/03/11 06:31:05 1.48 @@ -1,4 +1,4 @@ -/* $OpenBSD: layout.c,v 1.47 2019/07/15 18:43:32 nicm Exp $ */ +/* $OpenBSD: layout.c,v 1.48 2021/03/11 06:31:05 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -286,7 +286,7 @@ /* 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 @@ 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 @@ 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ /* 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 @@ 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);