aboutsummaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2010-12-06 22:52:21 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2010-12-06 22:52:21 +0000
commit3a4f765a51fd7cf98d655dc5a63746a6121d0212 (patch)
tree725352590fa509f59fdc3c8d297c2b3b7a586b49 /window.c
parentd0adcbc98a0261716c094c2e83c6d2eaa90a1c95 (diff)
downloadrtmux-3a4f765a51fd7cf98d655dc5a63746a6121d0212.tar.gz
rtmux-3a4f765a51fd7cf98d655dc5a63746a6121d0212.tar.bz2
rtmux-3a4f765a51fd7cf98d655dc5a63746a6121d0212.zip
Add an option to alert (monitor) for silence (lack of activity) in a
window. From Thomas Adam.
Diffstat (limited to 'window.c')
-rw-r--r--window.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/window.c b/window.c
index f81acc4f..1942e040 100644
--- a/window.c
+++ b/window.c
@@ -1,4 +1,4 @@
-/* $Id: window.c,v 1.141 2010-12-06 21:53:50 nicm Exp $ */
+/* $Id: window.c,v 1.142 2010-12-06 22:52:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -636,6 +636,14 @@ window_pane_read_callback(unused struct bufferevent *bufev, void *data)
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
+
+ /*
+ * If we get here, we're not outputting anymore, so set the silence
+ * flag on the window.
+ */
+ wp->window->flags |= WINDOW_SILENCE;
+ if (gettimeofday(&wp->window->silence_timer, NULL) != 0)
+ fatal("gettimeofday failed.");
}
/* ARGSUSED */