aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicm <nicm>2020-01-28 13:23:24 +0000
committernicm <nicm>2020-01-28 13:23:24 +0000
commitb905c5d455b354f7210dc118f748a658f0358cd7 (patch)
tree8ebd0ec36c2d9549fcd3f6ec79d0e9896bd1e93f
parente3887022604d6ee6f922cdaa274b54cdf06020ba (diff)
downloadrtmux-b905c5d455b354f7210dc118f748a658f0358cd7.tar.gz
rtmux-b905c5d455b354f7210dc118f748a658f0358cd7.tar.bz2
rtmux-b905c5d455b354f7210dc118f748a658f0358cd7.zip
If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler.
-rw-r--r--resize.c16
-rw-r--r--tmux.h3
2 files changed, 17 insertions, 2 deletions
diff --git a/resize.c b/resize.c
index b4142a70..96d733f0 100644
--- a/resize.c
+++ b/resize.c
@@ -66,10 +66,26 @@ resize_window(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
static int
ignore_client_size(struct client *c)
{
+ struct client *loop;
+
if (c->session == NULL)
return (1);
if (c->flags & CLIENT_NOSIZEFLAGS)
return (1);
+ if (c->flags & CLIENT_READONLY) {
+ /*
+ * Ignore readonly clients if there are any attached clients
+ * that aren't readonly.
+ */
+ TAILQ_FOREACH (loop, &clients, entry) {
+ if (loop->session == NULL)
+ continue;
+ if (loop->flags & CLIENT_NOSIZEFLAGS)
+ continue;
+ if (~loop->flags & CLIENT_READONLY)
+ return (1);
+ }
+ }
if ((c->flags & CLIENT_CONTROL) && (~c->flags & CLIENT_SIZECHANGED))
return (1);
return (0);
diff --git a/tmux.h b/tmux.h
index 3ec89019..418f0a44 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1590,8 +1590,7 @@ struct client {
#define CLIENT_NOSIZEFLAGS \
(CLIENT_DEAD| \
CLIENT_SUSPENDED| \
- CLIENT_DETACHING| \
- CLIENT_READONLY)
+ CLIENT_DETACHING)
int flags;
struct key_table *keytable;