[arch-commits] Commit in tmux/trunk (0001-fix-sizing.patch PKGBUILD)

Christian Hesse eworm at archlinux.org
Fri May 17 12:25:20 UTC 2019


    Date: Friday, May 17, 2019 @ 12:25:20
  Author: eworm
Revision: 467666

upgpkg: tmux 2.9_a-2

Fix sizing of main-vertical and main-horizontal layouts (GitHub #1736, FS#62510)

Added:
  tmux/trunk/0001-fix-sizing.patch
Modified:
  tmux/trunk/PKGBUILD

-----------------------+
 0001-fix-sizing.patch |  112 ++++++++++++++++++++++++++++++++++++++++++++++++
 PKGBUILD              |   10 +++-
 2 files changed, 121 insertions(+), 1 deletion(-)

Added: 0001-fix-sizing.patch
===================================================================
--- 0001-fix-sizing.patch	                        (rev 0)
+++ 0001-fix-sizing.patch	2019-05-17 12:25:20 UTC (rev 467666)
@@ -0,0 +1,112 @@
+commit 38b8a198bac62c16d351c54ed83ead29a2e0ecc8
+Author: nicm <nicm>
+Date:   Tue May 14 07:37:50 2019 +0000
+
+    Fix sizing of main-vertical and main-horizontal layouts, GitHub issue 1736.
+
+diff --git a/layout-set.c b/layout-set.c
+index 3a088a4c..12b4780f 100644
+--- a/layout-set.c
++++ b/layout-set.c
+@@ -185,7 +185,7 @@ layout_set_main_h(struct window *w)
+ {
+ 	struct window_pane	*wp;
+ 	struct layout_cell	*lc, *lcmain, *lcother, *lcchild;
+-	u_int			 n, mainh, otherh, sx;
++	u_int			 n, mainh, otherh, sx, sy;
+ 
+ 	layout_print_cell(w->layout_root, __func__, 1);
+ 
+@@ -195,22 +195,25 @@ layout_set_main_h(struct window *w)
+ 		return;
+ 	n--;	/* take off main pane */
+ 
++	/* Find available height - take off one line for the border. */
++	sy = w->sy - 1;
++
+ 	/* Get the main pane height and work out the other pane height. */
+ 	mainh = options_get_number(w->options, "main-pane-height");
+-	if (mainh + PANE_MINIMUM + 1 >= w->sy) {
+-		if (w->sy <= PANE_MINIMUM + 1 + PANE_MINIMUM)
++	if (mainh + PANE_MINIMUM >= sy) {
++		if (sy <= PANE_MINIMUM + PANE_MINIMUM)
+ 			mainh = PANE_MINIMUM;
+ 		else
+-			mainh = w->sy - (PANE_MINIMUM + 1);
++			mainh = sy - PANE_MINIMUM;
+ 		otherh = PANE_MINIMUM;
+ 	} else {
+ 		otherh = options_get_number(w->options, "other-pane-height");
+ 		if (otherh == 0)
+-			otherh = w->sy - mainh;
+-		else if (otherh > w->sy || w->sy - otherh < mainh)
+-			otherh = w->sy - mainh;
++			otherh = sy - mainh;
++		else if (otherh > sy || sy - otherh < mainh)
++			otherh = sy - mainh;
+ 		else
+-			mainh = w->sy - otherh;
++			mainh = sy - otherh;
+ 	}
+ 
+ 	/* Work out what width is needed. */
+@@ -221,7 +224,7 @@ layout_set_main_h(struct window *w)
+ 	/* Free old tree and create a new root. */
+ 	layout_free(w);
+ 	lc = w->layout_root = layout_create_cell(NULL);
+-	layout_set_size(lc, sx, mainh + otherh, 0, 0);
++	layout_set_size(lc, sx, mainh + otherh + 1, 0, 0);
+ 	layout_make_node(lc, LAYOUT_TOPBOTTOM);
+ 
+ 	/* Create the main pane. */
+@@ -269,7 +272,7 @@ layout_set_main_v(struct window *w)
+ {
+ 	struct window_pane	*wp;
+ 	struct layout_cell	*lc, *lcmain, *lcother, *lcchild;
+-	u_int			 n, mainw, otherw, sy;
++	u_int			 n, mainw, otherw, sx, sy;
+ 
+ 	layout_print_cell(w->layout_root, __func__, 1);
+ 
+@@ -279,22 +282,25 @@ layout_set_main_v(struct window *w)
+ 		return;
+ 	n--;	/* take off main pane */
+ 
++	/* Find available width - take off one line for the border. */
++	sx = w->sx - 1;
++
+ 	/* Get the main pane width and work out the other pane width. */
+ 	mainw = options_get_number(w->options, "main-pane-width");
+-	if (mainw + PANE_MINIMUM + 1 >= w->sx) {
+-		if (w->sx <= PANE_MINIMUM + 1 + PANE_MINIMUM)
++	if (mainw + PANE_MINIMUM >= sx) {
++		if (sx <= PANE_MINIMUM + PANE_MINIMUM)
+ 			mainw = PANE_MINIMUM;
+ 		else
+-			mainw = w->sx - (PANE_MINIMUM + 1);
++			mainw = sx - PANE_MINIMUM;
+ 		otherw = PANE_MINIMUM;
+ 	} else {
+ 		otherw = options_get_number(w->options, "other-pane-width");
+ 		if (otherw == 0)
+-			otherw = w->sx - mainw;
+-		else if (otherw > w->sx || w->sx - otherw < mainw)
+-			otherw = w->sx - mainw;
++			otherw = sx - mainw;
++		else if (otherw > sx || sx - otherw < mainw)
++			otherw = sx - mainw;
+ 		else
+-			mainw = w->sx - otherw;
++			mainw = sx - otherw;
+ 	}
+ 
+ 	/* Work out what height is needed. */
+@@ -305,7 +311,7 @@ layout_set_main_v(struct window *w)
+ 	/* Free old tree and create a new root. */
+ 	layout_free(w);
+ 	lc = w->layout_root = layout_create_cell(NULL);
+-	layout_set_size(lc, mainw + otherw, sy, 0, 0);
++	layout_set_size(lc, mainw + otherw + 1, sy, 0, 0);
+ 	layout_make_node(lc, LAYOUT_LEFTRIGHT);
+ 
+ 	/* Create the main pane. */

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2019-05-17 10:50:20 UTC (rev 467665)
+++ PKGBUILD	2019-05-17 12:25:20 UTC (rev 467666)
@@ -4,7 +4,7 @@
 
 pkgname=tmux
 pkgver=2.9_a
-pkgrel=1
+pkgrel=2
 pkgdesc='A terminal multiplexer'
 url='https://github.com/tmux/tmux/wiki'
 arch=('x86_64')
@@ -11,10 +11,18 @@
 license=('BSD')
 depends=('ncurses' 'libevent' 'libutempter')
 source=("https://github.com/tmux/tmux/releases/download/${pkgver/_/}/tmux-${pkgver/_/}.tar.gz"
+	'0001-fix-sizing.patch'
 	'LICENSE')
 sha256sums=('839d167a4517a6bffa6b6074e89a9a8630547b2dea2086f1fad15af12ab23b25'
+            '74c89e7c85622c44a07fdce1eefd021dbb0e484a02f7da210ae3ebfa5fdd2fe4'
             'b5de80619e4884ced2dfe0a96020e85dcfb715a831ecdfdd7ce8c97b5a6ff2cc')
 
+prepare() {
+	cd "$srcdir/$pkgname-${pkgver/_/}"
+
+	patch -Np1 < ../0001-fix-sizing.patch
+}
+
 build() {
 	cd "$srcdir/$pkgname-${pkgver/_/}"
 



More information about the arch-commits mailing list