From 9d42bd328c094c679415c623f7a87c200b64984e Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 12 Jun 2019 08:08:33 +0000 Subject: Do not always resize the window back to its original size after applying a layout, let the normal window resize process do it. This means windows are not resized at all if window-size is manual, and are not resized multiple times if later attached to a different size terminal. --- layout-custom.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'layout-custom.c') diff --git a/layout-custom.c b/layout-custom.c index 9886afe1..4d9e818b 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -168,10 +168,7 @@ layout_parse(struct window *w, const char *layout) /* Update pane offsets and sizes. */ layout_fix_offsets(lc); layout_fix_panes(w); - - /* Then resize the layout back to the original window size. */ - layout_resize(w, sx, sy); - window_resize(w, sx, sy); + recalculate_sizes(); layout_print_cell(lc, __func__, 0); -- cgit From 03da0ced46e0ddcfbdcc6d580d906f47279cabcd Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 15 Jun 2019 06:33:48 +0000 Subject: Use the right format modifier when comparing, and remove a couple of unused variables. --- layout-custom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'layout-custom.c') diff --git a/layout-custom.c b/layout-custom.c index 4d9e818b..bedcaf10 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -122,7 +122,7 @@ layout_parse(struct window *w, const char *layout) { struct layout_cell *lc, *lcchild; struct window_pane *wp; - u_int npanes, ncells, sx, sy; + u_int npanes, ncells; u_short csum; /* Check validity. */ @@ -153,8 +153,7 @@ layout_parse(struct window *w, const char *layout) layout_destroy_cell(w, lcchild, &lc); } - /* Save the old window size and resize to the layout size. */ - sx = w->sx; sy = w->sy; + /* Resize to the layout size. */ window_resize(w, lc->sx, lc->sy); /* Destroy the old layout and swap to the new. */ -- cgit From 6ceeceab7adfb7b6a779df52f811f010aae0721c Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 15 Jul 2019 18:25:07 +0000 Subject: Make layout_fix_offsets take a window like layout_fix_panes. --- layout-custom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layout-custom.c') diff --git a/layout-custom.c b/layout-custom.c index bedcaf10..d759c206 100644 --- a/layout-custom.c +++ b/layout-custom.c @@ -165,7 +165,7 @@ layout_parse(struct window *w, const char *layout) layout_assign(&wp, lc); /* Update pane offsets and sizes. */ - layout_fix_offsets(lc); + layout_fix_offsets(w); layout_fix_panes(w); recalculate_sizes(); -- cgit