version 1.28, 2019/03/04 09:29:52 |
version 1.29, 2019/03/12 13:56:30 |
|
|
notify_window("window-layout-changed", w); |
notify_window("window-layout-changed", w); |
} |
} |
|
|
|
static int |
|
ignore_client_size(struct client *c) |
|
{ |
|
if (c->session == NULL) |
|
return (1); |
|
if (c->flags & CLIENT_NOSIZEFLAGS) |
|
return (1); |
|
if ((c->flags & CLIENT_CONTROL) && (~c->flags & CLIENT_SIZECHANGED)) |
|
return (1); |
|
return (0); |
|
} |
|
|
void |
void |
default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy, |
default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy, |
int type) |
int type) |
|
|
if (type == WINDOW_SIZE_LARGEST) { |
if (type == WINDOW_SIZE_LARGEST) { |
*sx = *sy = 0; |
*sx = *sy = 0; |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session == NULL) |
if (ignore_client_size(c)) |
continue; |
continue; |
if (c->flags & CLIENT_NOSIZEFLAGS) |
|
continue; |
|
if (w != NULL && !session_has(c->session, w)) |
if (w != NULL && !session_has(c->session, w)) |
continue; |
continue; |
if (w == NULL && c->session != s) |
if (w == NULL && c->session != s) |
|
|
} else { |
} else { |
*sx = *sy = UINT_MAX; |
*sx = *sy = UINT_MAX; |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (c->session == NULL) |
if (ignore_client_size(c)) |
continue; |
continue; |
if (c->flags & CLIENT_NOSIZEFLAGS) |
|
continue; |
|
if (w != NULL && !session_has(c->session, w)) |
if (w != NULL && !session_has(c->session, w)) |
continue; |
continue; |
if (w == NULL && c->session != s) |
if (w == NULL && c->session != s) |
|
|
struct client *c; |
struct client *c; |
struct window *w; |
struct window *w; |
u_int sx, sy, cx, cy; |
u_int sx, sy, cx, cy; |
int flags, type, current, has, changed; |
int type, current, has, changed; |
|
|
/* |
/* |
* Clear attached count and update saved status line information for |
* Clear attached count and update saved status line information for |
|
|
* client. |
* client. |
*/ |
*/ |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if ((s = c->session) == NULL) |
if (ignore_client_size(c)) |
continue; |
continue; |
|
|
flags = c->flags; |
|
if (flags & CLIENT_SUSPENDED) |
|
continue; |
|
if ((flags & CLIENT_CONTROL) && (~flags & CLIENT_SIZECHANGED)) |
|
continue; |
|
|
|
if (c->tty.sy <= status_line_size(c)) |
if (c->tty.sy <= status_line_size(c)) |
c->flags |= CLIENT_STATUSOFF; |
c->flags |= CLIENT_STATUSOFF; |
else |
else |
c->flags &= ~CLIENT_STATUSOFF; |
c->flags &= ~CLIENT_STATUSOFF; |
|
c->session->attached++; |
s->attached++; |
|
} |
} |
|
|
/* Walk each window and adjust the size. */ |
/* Walk each window and adjust the size. */ |
|
|
if (type == WINDOW_SIZE_LARGEST) { |
if (type == WINDOW_SIZE_LARGEST) { |
sx = sy = 0; |
sx = sy = 0; |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if ((s = c->session) == NULL) |
if (ignore_client_size(c)) |
continue; |
continue; |
|
s = c->session; |
|
|
if (current) |
if (current) |
has = (s->curw->window == w); |
has = (s->curw->window == w); |
else |
else |
|
|
} else { |
} else { |
sx = sy = UINT_MAX; |
sx = sy = UINT_MAX; |
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if ((s = c->session) == NULL) |
if (ignore_client_size(c)) |
continue; |
continue; |
|
s = c->session; |
|
|
if (current) |
if (current) |
has = (s->curw->window == w); |
has = (s->curw->window == w); |
else |
else |