=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/notify.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- src/usr.bin/tmux/notify.c 2017/08/30 10:33:57 1.25 +++ src/usr.bin/tmux/notify.c 2018/07/04 12:30:52 1.26 @@ -1,4 +1,4 @@ -/* $OpenBSD: notify.c,v 1.25 2017/08/30 10:33:57 nicm Exp $ */ +/* $OpenBSD: notify.c,v 1.26 2018/07/04 12:30:52 nicm Exp $ */ /* * Copyright (c) 2012 George Nachman @@ -36,7 +36,7 @@ }; 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; @@ -102,7 +102,7 @@ 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); @@ -152,6 +152,24 @@ new_item = cmdq_get_callback(notify_callback, ne); cmdq_append(NULL, new_item); +} + +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