If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler.

This commit is contained in:
nicm 2020-01-28 13:23:24 +00:00
parent e388702260
commit b905c5d455
2 changed files with 17 additions and 2 deletions

View File

@ -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);

3
tmux.h
View File

@ -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;