summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/layout.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2019-04-17 14:43:49 +0000
committernicm <nicm@openbsd.org>2019-04-17 14:43:49 +0000
commitd4ddf7e1665cc214d55aeaa38156b8cf76b4c8bf (patch)
tree2def0da642d75e0b90b3e329f5428d7f07c9573c /usr.bin/tmux/layout.c
parentDo not let the size of the pane status screen go negative. (diff)
downloadwireguard-openbsd-d4ddf7e1665cc214d55aeaa38156b8cf76b4c8bf.tar.xz
wireguard-openbsd-d4ddf7e1665cc214d55aeaa38156b8cf76b4c8bf.zip
Set the window size as well as the layout size when using the preset
layouts.
Diffstat (limited to 'usr.bin/tmux/layout.c')
-rw-r--r--usr.bin/tmux/layout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tmux/layout.c b/usr.bin/tmux/layout.c
index 2cf22b4e937..798ad29389f 100644
--- a/usr.bin/tmux/layout.c
+++ b/usr.bin/tmux/layout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: layout.c,v 1.40 2019/04/17 14:37:48 nicm Exp $ */
+/* $OpenBSD: layout.c,v 1.41 2019/04/17 14:43:49 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -479,7 +479,7 @@ layout_resize(struct window *w, u_int sx, u_int sy)
* out proportionately - this should leave the layout fitting the new
* window size.
*/
- xchange = sx - w->sx;
+ xchange = sx - lc->sx;
xlimit = layout_resize_check(w, lc, LAYOUT_LEFTRIGHT);
if (xchange < 0 && xchange < -xlimit)
xchange = -xlimit;
@@ -493,7 +493,7 @@ layout_resize(struct window *w, u_int sx, u_int sy)
layout_resize_adjust(w, lc, LAYOUT_LEFTRIGHT, xchange);
/* Adjust vertically in a similar fashion. */
- ychange = sy - w->sy;
+ ychange = sy - lc->sy;
ylimit = layout_resize_check(w, lc, LAYOUT_TOPBOTTOM);
if (ychange < 0 && ychange < -ylimit)
ychange = -ylimit;