Ignore clients that are suspended or exiting.

This commit is contained in:
Nicholas Marriott 2018-09-25 09:48:48 +01:00
parent 57069287a1
commit 26d73a7736
2 changed files with 14 additions and 5 deletions

View File

@ -79,6 +79,8 @@ default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
TAILQ_FOREACH(c, &clients, entry) {
if (c->session == NULL)
continue;
if (c->flags & CLIENT_NOSIZEFLAGS)
continue;
if (w != NULL && !session_has(c->session, w))
continue;
if (w == NULL && c->session != s)
@ -99,6 +101,8 @@ default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy,
TAILQ_FOREACH(c, &clients, entry) {
if (c->session == NULL)
continue;
if (c->flags & CLIENT_NOSIZEFLAGS)
continue;
if (w != NULL && !session_has(c->session, w))
continue;
if (w == NULL && c->session != s)
@ -209,7 +213,7 @@ recalculate_sizes(void)
}
if (sx == 0 || sy == 0)
changed = 0;
} else if (type == WINDOW_SIZE_SMALLEST) {
} else {
sx = sy = UINT_MAX;
TAILQ_FOREACH(c, &clients, entry) {
if ((s = c->session) == NULL)

13
tmux.h
View File

@ -1357,11 +1357,16 @@ struct client {
#define CLIENT_SIZECHANGED 0x400000
#define CLIENT_STATUSOFF 0x800000
#define CLIENT_REDRAWSTATUSALWAYS 0x1000000
#define CLIENT_ALLREDRAWFLAGS \
(CLIENT_REDRAWWINDOW| \
CLIENT_REDRAWSTATUS| \
CLIENT_REDRAWSTATUSALWAYS| \
#define CLIENT_ALLREDRAWFLAGS \
(CLIENT_REDRAWWINDOW| \
CLIENT_REDRAWSTATUS| \
CLIENT_REDRAWSTATUSALWAYS| \
CLIENT_REDRAWBORDERS)
#define CLIENT_NOSIZEFLAGS \
(CLIENT_EXIT| \
CLIENT_DEAD| \
CLIENT_SUSPENDED| \
CLIENT_DETACHING)
int flags;
struct key_table *keytable;