summaryrefslogtreecommitdiffstats
path: root/server-fn.c
diff options
context:
space:
mode:
Diffstat (limited to 'server-fn.c')
-rw-r--r--server-fn.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/server-fn.c b/server-fn.c
index 72750321..8fad6791 100644
--- a/server-fn.c
+++ b/server-fn.c
@@ -258,7 +258,8 @@ server_link_window(struct session *src, struct winlink *srcwl,
* Can't use session_detach as it will destroy session
* if this makes it empty.
*/
- notify_window_unlinked(dst, dstwl->window);
+ notify_session_window("window-unlinked", dst,
+ dstwl->window);
dstwl->flags &= ~WINLINK_ALERTFLAGS;
winlink_stack_remove(&dst->lastw, dstwl);
winlink_remove(&dst->windows, dstwl);
@@ -294,13 +295,12 @@ server_unlink_window(struct session *s, struct winlink *wl)
}
void
-server_destroy_pane(struct window_pane *wp, int hooks)
+server_destroy_pane(struct window_pane *wp, int notify)
{
struct window *w = wp->window;
int old_fd;
struct screen_write_ctx ctx;
struct grid_cell gc;
- struct cmd_find_state fs;
old_fd = wp->fd;
if (wp->fd != -1) {
@@ -312,6 +312,10 @@ server_destroy_pane(struct window_pane *wp, int hooks)
if (options_get_number(w->options, "remain-on-exit")) {
if (old_fd == -1)
return;
+
+ if (notify)
+ notify_pane("pane-died", wp);
+
screen_write_start(&ctx, wp, &wp->base);
screen_write_scrollregion(&ctx, 0, screen_size_y(ctx.s) - 1);
screen_write_cursormove(&ctx, 0, screen_size_y(ctx.s) - 1);
@@ -322,18 +326,16 @@ server_destroy_pane(struct window_pane *wp, int hooks)
screen_write_stop(&ctx);
wp->flags |= PANE_REDRAW;
- if (hooks && cmd_find_from_pane(&fs, wp) == 0)
- hooks_run(hooks_get(fs.s), NULL, &fs, "pane-died");
return;
}
+ if (notify)
+ notify_pane("pane-exited", wp);
+
server_unzoom_window(w);
layout_close_pane(wp);
window_remove_pane(w, wp);
- if (hooks && cmd_find_from_window(&fs, w) == 0)
- hooks_run(hooks_get(fs.s), NULL, &fs, "pane-exited");
-
if (TAILQ_EMPTY(&w->panes))
server_kill_window(w);
else
@@ -394,7 +396,7 @@ server_destroy_session(struct session *s)
c->session = s_new;
server_client_set_key_table(c, NULL);
status_timer_start(c);
- notify_attached_session_changed(c);
+ notify_client("client-session-changed", c);
session_update_activity(s_new, NULL);
gettimeofday(&s_new->last_attached_time, NULL);
server_redraw_client(c);