mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
If ALL clients are readonly, allow them to affect the size, suggested by Thomas Sattler.
This commit is contained in:
16
resize.c
16
resize.c
@ -66,10 +66,26 @@ resize_window(struct window *w, u_int sx, u_int sy, int xpixel, int ypixel)
|
|||||||
static int
|
static int
|
||||||
ignore_client_size(struct client *c)
|
ignore_client_size(struct client *c)
|
||||||
{
|
{
|
||||||
|
struct client *loop;
|
||||||
|
|
||||||
if (c->session == NULL)
|
if (c->session == NULL)
|
||||||
return (1);
|
return (1);
|
||||||
if (c->flags & CLIENT_NOSIZEFLAGS)
|
if (c->flags & CLIENT_NOSIZEFLAGS)
|
||||||
return (1);
|
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))
|
if ((c->flags & CLIENT_CONTROL) && (~c->flags & CLIENT_SIZECHANGED))
|
||||||
return (1);
|
return (1);
|
||||||
return (0);
|
return (0);
|
||||||
|
3
tmux.h
3
tmux.h
@ -1590,8 +1590,7 @@ struct client {
|
|||||||
#define CLIENT_NOSIZEFLAGS \
|
#define CLIENT_NOSIZEFLAGS \
|
||||||
(CLIENT_DEAD| \
|
(CLIENT_DEAD| \
|
||||||
CLIENT_SUSPENDED| \
|
CLIENT_SUSPENDED| \
|
||||||
CLIENT_DETACHING| \
|
CLIENT_DETACHING)
|
||||||
CLIENT_READONLY)
|
|
||||||
int flags;
|
int flags;
|
||||||
struct key_table *keytable;
|
struct key_table *keytable;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user