=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/resize.c,v retrieving revision 1.28 retrieving revision 1.29 diff -c -r1.28 -r1.29 *** src/usr.bin/tmux/resize.c 2019/03/04 09:29:52 1.28 --- src/usr.bin/tmux/resize.c 2019/03/12 13:56:30 1.29 *************** *** 1,4 **** ! /* $OpenBSD: resize.c,v 1.28 2019/03/04 09:29:52 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: resize.c,v 1.29 2019/03/12 13:56:30 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 61,66 **** --- 61,78 ---- 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 default_window_size(struct session *s, struct window *w, u_int *sx, u_int *sy, int type) *************** *** 77,86 **** if (type == WINDOW_SIZE_LARGEST) { *sx = *sy = 0; 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) --- 89,96 ---- if (type == WINDOW_SIZE_LARGEST) { *sx = *sy = 0; TAILQ_FOREACH(c, &clients, entry) { ! if (ignore_client_size(c)) continue; if (w != NULL && !session_has(c->session, w)) continue; if (w == NULL && c->session != s) *************** *** 99,108 **** } else { *sx = *sy = UINT_MAX; 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) --- 109,116 ---- } else { *sx = *sy = UINT_MAX; TAILQ_FOREACH(c, &clients, entry) { ! if (ignore_client_size(c)) continue; if (w != NULL && !session_has(c->session, w)) continue; if (w == NULL && c->session != s) *************** *** 146,152 **** struct client *c; struct window *w; u_int sx, sy, cx, cy; ! int flags, type, current, has, changed; /* * Clear attached count and update saved status line information for --- 154,160 ---- struct client *c; struct window *w; u_int sx, sy, cx, cy; ! int type, current, has, changed; /* * Clear attached count and update saved status line information for *************** *** 162,182 **** * client. */ TAILQ_FOREACH(c, &clients, entry) { ! if ((s = c->session) == NULL) 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)) c->flags |= CLIENT_STATUSOFF; else c->flags &= ~CLIENT_STATUSOFF; ! ! s->attached++; } /* Walk each window and adjust the size. */ --- 170,182 ---- * client. */ TAILQ_FOREACH(c, &clients, entry) { ! if (ignore_client_size(c)) continue; if (c->tty.sy <= status_line_size(c)) c->flags |= CLIENT_STATUSOFF; else c->flags &= ~CLIENT_STATUSOFF; ! c->session->attached++; } /* Walk each window and adjust the size. */ *************** *** 194,201 **** if (type == WINDOW_SIZE_LARGEST) { sx = sy = 0; TAILQ_FOREACH(c, &clients, entry) { ! if ((s = c->session) == NULL) continue; if (current) has = (s->curw->window == w); else --- 194,203 ---- if (type == WINDOW_SIZE_LARGEST) { sx = sy = 0; TAILQ_FOREACH(c, &clients, entry) { ! if (ignore_client_size(c)) continue; + s = c->session; + if (current) has = (s->curw->window == w); else *************** *** 216,223 **** } else { sx = sy = UINT_MAX; TAILQ_FOREACH(c, &clients, entry) { ! if ((s = c->session) == NULL) continue; if (current) has = (s->curw->window == w); else --- 218,227 ---- } else { sx = sy = UINT_MAX; TAILQ_FOREACH(c, &clients, entry) { ! if (ignore_client_size(c)) continue; + s = c->session; + if (current) has = (s->curw->window == w); else