diff options
author | nicm <nicm> | 2020-01-28 13:23:24 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-01-28 13:23:24 +0000 |
commit | b905c5d455b354f7210dc118f748a658f0358cd7 (patch) | |
tree | 8ebd0ec36c2d9549fcd3f6ec79d0e9896bd1e93f | |
parent | e3887022604d6ee6f922cdaa274b54cdf06020ba (diff) | |
download | rtmux-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.c | 16 | ||||
-rw-r--r-- | tmux.h | 3 |
2 files changed, 17 insertions, 2 deletions
@@ -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); @@ -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; |