summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-24 07:02:57 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-24 07:02:57 +0000
commit0ff8502e78c4bd27c0dd2417004c4493cad08109 (patch)
tree21a765d92ab629d03c3e6846fc7e4c06965ac0eb /usr.bin/tmux
parent0f4b6f6652bb4ee08f266a4abce81d81fc86880d (diff)
Don't allow locked or suspended clients to limit the size of active clients.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-lock-server.c3
-rw-r--r--usr.bin/tmux/resize.c4
-rw-r--r--usr.bin/tmux/server-msg.c3
-rw-r--r--usr.bin/tmux/server.c6
4 files changed, 10 insertions, 6 deletions
diff --git a/usr.bin/tmux/cmd-lock-server.c b/usr.bin/tmux/cmd-lock-server.c
index 37d424af832..f3ed3d06427 100644
--- a/usr.bin/tmux/cmd-lock-server.c
+++ b/usr.bin/tmux/cmd-lock-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-lock-server.c,v 1.4 2009/07/26 12:58:44 nicm Exp $ */
+/* $OpenBSD: cmd-lock-server.c,v 1.5 2009/09/24 07:02:56 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -45,6 +45,7 @@ int
cmd_lock_server_exec(unused struct cmd *self, unused struct cmd_ctx *ctx)
{
server_lock();
+ recalculate_sizes();
return (0);
}
diff --git a/usr.bin/tmux/resize.c b/usr.bin/tmux/resize.c
index 7f5aaa48aac..7c085aedbe7 100644
--- a/usr.bin/tmux/resize.c
+++ b/usr.bin/tmux/resize.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resize.c,v 1.3 2009/07/19 13:21:40 nicm Exp $ */
+/* $OpenBSD: resize.c,v 1.4 2009/09/24 07:02:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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/usr.bin/tmux/server-msg.c b/usr.bin/tmux/server-msg.c
index 96b38592df9..0a0937ae45d 100644
--- a/usr.bin/tmux/server-msg.c
+++ b/usr.bin/tmux/server-msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-msg.c,v 1.21 2009/09/23 12:03:31 nicm Exp $ */
+/* $OpenBSD: server-msg.c,v 1.22 2009/09/24 07:02:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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:
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c
index 6fbd75cb642..e46c713eb5e 100644
--- a/usr.bin/tmux/server.c
+++ b/usr.bin/tmux/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.42 2009/09/23 08:21:57 nicm Exp $ */
+/* $OpenBSD: server.c,v 1.43 2009/09/24 07:02:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);