summaryrefslogtreecommitdiffstats
path: root/resize.c
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 /resize.c
parente3887022604d6ee6f922cdaa274b54cdf06020ba (diff)
If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler.
Diffstat (limited to 'resize.c')
-rw-r--r--resize.c16
1 files changed, 16 insertions, 0 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);