diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-09-24 07:02:56 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-09-24 07:02:56 +0000 |
commit | 1764ef81efce5f265f61107f0b1e91d73b858fb4 (patch) | |
tree | 4aae9f33dbc264a52108d60eec3a551740fe1b30 | |
parent | fecf8dc44ee88bd5aee02035d13b118fa514f253 (diff) | |
download | rtmux-1764ef81efce5f265f61107f0b1e91d73b858fb4.tar.gz rtmux-1764ef81efce5f265f61107f0b1e91d73b858fb4.tar.bz2 rtmux-1764ef81efce5f265f61107f0b1e91d73b858fb4.zip |
Don't allow locked or suspended clients to limit the size of active clients.
-rw-r--r-- | cmd-lock-server.c | 1 | ||||
-rw-r--r-- | resize.c | 2 | ||||
-rw-r--r-- | server-msg.c | 1 | ||||
-rw-r--r-- | server.c | 4 |
4 files changed, 6 insertions, 2 deletions
diff --git a/cmd-lock-server.c b/cmd-lock-server.c index 54f2efd2..55c19e38 100644 --- a/cmd-lock-server.c +++ b/cmd-lock-server.c @@ -45,6 +45,7 @@ int cmd_lock_server_exec(unused struct cmd *self, unused struct cmd_ctx *ctx) { server_lock(); + recalculate_sizes(); return (0); } @@ -60,7 +60,7 @@ recalculate_sizes(void) ssx = ssy = UINT_MAX; for (j = 0; j < ARRAY_LENGTH(&clients); j++) { c = ARRAY_ITEM(&clients, j); - if (c == NULL) + if (c == NULL || c->flags & CLIENT_SUSPENDED) continue; if (c->session == s) { if (c->tty.sx < ssx) diff --git a/server-msg.c b/server-msg.c index b7b45c6c..ec085610 100644 --- a/server-msg.c +++ b/server-msg.c @@ -104,6 +104,7 @@ server_msg_dispatch(struct client *c) c->flags &= ~CLIENT_SUSPENDED; tty_start_tty(&c->tty); server_redraw_client(c); + recalculate_sizes(); server_activity = time(NULL); break; case MSG_ENVIRON: @@ -1194,8 +1194,10 @@ server_second_timers(void) t = time(NULL); xtimeout = options_get_number(&global_s_options, "lock-after-time"); - if (xtimeout > 0 && t > server_activity + xtimeout) + if (xtimeout > 0 && t > server_activity + xtimeout) { server_lock(); + recalculate_sizes(); + } for (i = 0; i < ARRAY_LENGTH(&windows); i++) { w = ARRAY_ITEM(&windows, i); |