aboutsummaryrefslogtreecommitdiff
path: root/resize.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-06-05 10:01:22 +0100
committerThomas Adam <thomas@xteddy.org>2020-06-05 10:01:22 +0100
commita06cf900c7f8443a63005b6a2c59d11095d2a259 (patch)
tree6d4882ef037117aaf9c8663e5fb42a96f7966000 /resize.c
parent976cf6c60fbb7bb95a805ce451281bf9dd5d43f8 (diff)
parent4e5e2c19d0bb9aaad12ddd6dd0fc50a150a6c0cb (diff)
downloadrtmux-a06cf900c7f8443a63005b6a2c59d11095d2a259.tar.gz
rtmux-a06cf900c7f8443a63005b6a2c59d11095d2a259.tar.bz2
rtmux-a06cf900c7f8443a63005b6a2c59d11095d2a259.zip
Merge branch 'obsd-master'
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/resize.c b/resize.c
index 68717e35..d6e6dce2 100644
--- a/resize.c
+++ b/resize.c
@@ -227,7 +227,7 @@ done:
}
void
-recalculate_size(struct window *w)
+recalculate_size(struct window *w, int now)
{
struct session *s;
struct client *c;
@@ -348,10 +348,10 @@ recalculate_size(struct window *w)
break;
}
if (w->flags & WINDOW_RESIZE) {
- if (changed && w->new_sx == sx && w->new_sy == sy)
+ if (!now && changed && w->new_sx == sx && w->new_sy == sy)
changed = 0;
} else {
- if (changed && w->sx == sx && w->sy == sy)
+ if (!now && changed && w->sx == sx && w->sy == sy)
changed = 0;
}
@@ -360,7 +360,7 @@ recalculate_size(struct window *w)
return;
}
log_debug("%s: @%u new size %u,%u", __func__, w->id, sx, sy);
- if (type == WINDOW_SIZE_MANUAL)
+ if (now || type == WINDOW_SIZE_MANUAL)
resize_window(w, sx, sy, xpixel, ypixel);
else {
w->new_sx = sx;
@@ -376,6 +376,12 @@ recalculate_size(struct window *w)
void
recalculate_sizes(void)
{
+ recalculate_sizes_now(0);
+}
+
+void
+recalculate_sizes_now(int now)
+{
struct session *s;
struct client *c;
struct window *w;
@@ -407,5 +413,5 @@ recalculate_sizes(void)
/* Walk each window and adjust the size. */
RB_FOREACH(w, windows, &windows)
- recalculate_size(w);
+ recalculate_size(w, now);
}