From b905c5d455b354f7210dc118f748a658f0358cd7 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 28 Jan 2020 13:23:24 +0000 Subject: If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler. --- resize.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'resize.c') 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); -- cgit v1.2.3