aboutsummaryrefslogtreecommitdiff
path: root/resize.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-11-19 09:22:03 +0000
committerThomas Adam <thomas@xteddy.org>2014-11-19 09:22:03 +0000
commit3e8efcc555a2767ff0abc121cb3232d7e84c3873 (patch)
treed655f7fdb10952e417cd79e2f907e5e9d75ea0c5 /resize.c
parentbd803e82e96512473036461ec3832c569768e535 (diff)
parente0929262db947f984964f979a23215c0de75ceb2 (diff)
downloadrtmux-3e8efcc555a2767ff0abc121cb3232d7e84c3873.tar.gz
rtmux-3e8efcc555a2767ff0abc121cb3232d7e84c3873.tar.bz2
rtmux-3e8efcc555a2767ff0abc121cb3232d7e84c3873.zip
Merge branch 'obsd-master'
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/resize.c b/resize.c
index 73a728fa..9ad73c81 100644
--- a/resize.c
+++ b/resize.c
@@ -50,7 +50,7 @@ recalculate_sizes(void)
struct window *w;
struct window_pane *wp;
u_int i, j, ssx, ssy, has, limit;
- int flag, has_status, is_zoomed;
+ int flag, has_status, is_zoomed, forced;
RB_FOREACH(s, sessions, &sessions) {
has_status = options_get_number(&s->options, "status");
@@ -116,18 +116,26 @@ recalculate_sizes(void)
if (ssx == UINT_MAX || ssy == UINT_MAX)
continue;
+ forced = 0;
limit = options_get_number(&w->options, "force-width");
- if (limit >= PANE_MINIMUM && ssx > limit)
+ if (limit >= PANE_MINIMUM && ssx > limit) {
ssx = limit;
+ forced |= WINDOW_FORCEWIDTH;
+ }
limit = options_get_number(&w->options, "force-height");
- if (limit >= PANE_MINIMUM && ssy > limit)
+ if (limit >= PANE_MINIMUM && ssy > limit) {
ssy = limit;
+ forced |= WINDOW_FORCEHEIGHT;
+ }
if (w->sx == ssx && w->sy == ssy)
continue;
log_debug("window size %u,%u (was %u,%u)", ssx, ssy, w->sx,
w->sy);
+ w->flags &= ~(WINDOW_FORCEWIDTH|WINDOW_FORCEHEIGHT);
+ w->flags |= forced;
+
is_zoomed = w->flags & WINDOW_ZOOMED;
if (is_zoomed)
window_unzoom(w);