=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/layout-set.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/tmux/layout-set.c 2019/04/04 10:25:35 1.22 --- src/usr.bin/tmux/layout-set.c 2019/04/17 14:43:49 1.23 *************** *** 1,4 **** ! /* $OpenBSD: layout-set.c,v 1.22 2019/04/04 10:25:35 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: layout-set.c,v 1.23 2019/04/17 14:43:49 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 119,125 **** { struct window_pane *wp; struct layout_cell *lc, *lcnew; ! u_int n; layout_print_cell(w->layout_root, __func__, 1); --- 119,125 ---- { struct window_pane *wp; struct layout_cell *lc, *lcnew; ! u_int n, sx, sy; layout_print_cell(w->layout_root, __func__, 1); *************** *** 131,137 **** /* Free the old root and construct a new. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); ! layout_set_size(lc, w->sx, w->sy, 0, 0); layout_make_node(lc, type); /* Build new leaf cells. */ --- 131,148 ---- /* Free the old root and construct a new. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); ! if (type == LAYOUT_LEFTRIGHT) { ! sx = (n * (PANE_MINIMUM + 1)) - 1; ! if (sx < w->sx) ! sx = w->sx; ! sy = w->sy; ! } else { ! sy = (n * (PANE_MINIMUM + 1)) - 1; ! if (sy < w->sy) ! sy = w->sy; ! sx = w->sx; ! } ! layout_set_size(lc, sx, sy, 0, 0); layout_make_node(lc, type); /* Build new leaf cells. */ *************** *** 152,157 **** --- 163,169 ---- layout_print_cell(w->layout_root, __func__, 1); + window_resize(w, lc->sx, lc->sy); notify_window("window-layout-changed", w); server_redraw_window(w); } *************** *** 288,293 **** --- 300,306 ---- layout_print_cell(w->layout_root, __func__, 1); + window_resize(w, lc->sx, lc->sy); notify_window("window-layout-changed", w); server_redraw_window(w); } *************** *** 412,417 **** --- 425,431 ---- layout_print_cell(w->layout_root, __func__, 1); + window_resize(w, lc->sx, lc->sy); notify_window("window-layout-changed", w); server_redraw_window(w); } *************** *** 421,427 **** { struct window_pane *wp; struct layout_cell *lc, *lcrow, *lcchild; ! u_int n, width, height, used; u_int i, j, columns, rows; layout_print_cell(w->layout_root, __func__, 1); --- 435,441 ---- { struct window_pane *wp; struct layout_cell *lc, *lcrow, *lcchild; ! u_int n, width, height, used, sx, sy; u_int i, j, columns, rows; layout_print_cell(w->layout_root, __func__, 1); *************** *** 450,456 **** /* Free old tree and create a new root. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); ! layout_set_size(lc, w->sx, w->sy, 0, 0); layout_make_node(lc, LAYOUT_TOPBOTTOM); /* Create a grid of the cells. */ --- 464,476 ---- /* Free old tree and create a new root. */ layout_free(w); lc = w->layout_root = layout_create_cell(NULL); ! sx = ((width + 1) * columns) - 1; ! if (sx < w->sx) ! sx = w->sx; ! sy = ((height + 1) * rows) - 1; ! if (sy < w->sy) ! sy = w->sy; ! layout_set_size(lc, sx, sy, 0, 0); layout_make_node(lc, LAYOUT_TOPBOTTOM); /* Create a grid of the cells. */ *************** *** 514,519 **** --- 534,540 ---- layout_print_cell(w->layout_root, __func__, 1); + window_resize(w, lc->sx, lc->sy); notify_window("window-layout-changed", w); server_redraw_window(w); }