summaryrefslogtreecommitdiffstats
path: root/notify.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2018-07-04 15:02:25 +0100
committerThomas Adam <thomas@xteddy.org>2018-07-04 15:02:25 +0100
commit20154f391ea0821d4e58ce952b69e08a33209b74 (patch)
treec4dc2791ead38feeb455d5279ecdbe31f5d0862c /notify.c
parent5c0ce192ed313c988f7d67e4911ef602a894cea0 (diff)
parent98c4291df2201271a0d70fc141cfaf744021ff35 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'notify.c')
-rw-r--r--notify.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/notify.c b/notify.c
index 05b9d842..adef3d4e 100644
--- a/notify.c
+++ b/notify.c
@@ -35,7 +35,7 @@ struct notify_entry {
};
static void
-notify_hook(struct cmdq_item *item, struct notify_entry *ne)
+notify_hook1(struct cmdq_item *item, struct notify_entry *ne)
{
struct cmd_find_state fs;
struct hook *hook;
@@ -101,7 +101,7 @@ notify_callback(struct cmdq_item *item, void *data)
if (strcmp(ne->name, "session-window-changed") == 0)
control_notify_session_window_changed(ne->session);
- notify_hook(item, ne);
+ notify_hook1(item, ne);
if (ne->client != NULL)
server_client_unref(ne->client);
@@ -154,6 +154,24 @@ notify_add(const char *name, struct cmd_find_state *fs, struct client *c,
}
void
+notify_hook(struct cmdq_item *item, const char *name)
+{
+ struct notify_entry ne;
+
+ memset(&ne, 0, sizeof ne);
+
+ ne.name = name;
+ cmd_find_copy_state(&ne.fs, &item->target);
+
+ ne.client = item->client;
+ ne.session = item->target.s;
+ ne.window = item->target.w;
+ ne.pane = item->target.wp->id;
+
+ notify_hook1(item, &ne);
+}
+
+void
notify_input(struct window_pane *wp, struct evbuffer *input)
{
struct client *c;