summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/notify.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-09-25 07:41:23 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-09-25 07:41:23 +0000
commit364f9c056d58d6405fd541d95b067d8af7b7ed8b (patch)
tree2feb15c4d90974fe1915c55f8884e696e4c4cd67 /usr.bin/tmux/notify.c
parent3d4cdfc1fd61fa3b649de9056b5eca2cc058a564 (diff)
Add notification for input from a pane, from George Nachman.
Diffstat (limited to 'usr.bin/tmux/notify.c')
-rw-r--r--usr.bin/tmux/notify.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.bin/tmux/notify.c b/usr.bin/tmux/notify.c
index d0157dced55..dfd415bee19 100644
--- a/usr.bin/tmux/notify.c
+++ b/usr.bin/tmux/notify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: notify.c,v 1.4 2012/09/03 09:32:38 nicm Exp $ */
+/* $OpenBSD: notify.c,v 1.5 2012/09/25 07:41:22 nicm Exp $ */
/*
* Copyright (c) 2012 George Nachman <tmux@georgester.com>
@@ -133,6 +133,26 @@ notify_drain(void)
}
void
+notify_input(struct window_pane *wp, struct evbuffer *input)
+{
+ struct client *c;
+ u_int i;
+
+ /*
+ * notify_input() is not queued and only does anything when
+ * notifications are enabled.
+ */
+ if (!notify_enabled)
+ return;
+
+ for (i = 0; i < ARRAY_LENGTH(&clients); i++) {
+ c = ARRAY_ITEM(&clients, i);
+ if (c != NULL && (c->flags & CLIENT_CONTROL))
+ control_notify_input(c, wp, input);
+ }
+}
+
+void
notify_window_layout_changed(struct window *w)
{
notify_add(NOTIFY_WINDOW_LAYOUT_CHANGED, NULL, NULL, w);