diff options
Diffstat (limited to 'control-notify.c')
-rw-r--r-- | control-notify.c | 71 |
1 files changed, 62 insertions, 9 deletions
diff --git a/control-notify.c b/control-notify.c index 230bce61..49291483 100644 --- a/control-notify.c +++ b/control-notify.c @@ -60,13 +60,26 @@ control_notify_input(struct client *c, struct window_pane *wp, } void +control_notify_pane_mode_changed(int pane) +{ + struct client *c; + + TAILQ_FOREACH(c, &clients, entry) { + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) + continue; + + control_write(c, "%%pane-mode-changed %%%u", pane); + } +} + +void control_notify_window_layout_changed(struct window *w) { - struct client *c; - struct session *s; - struct winlink *wl; - const char *template; - char *cp; + struct client *c; + struct session *s; + struct winlink *wl; + const char *template; + char *cp; template = "%layout-change #{window_id} #{window_layout} " "#{window_visible_layout} #{window_flags}"; @@ -97,6 +110,20 @@ control_notify_window_layout_changed(struct window *w) } void +control_notify_window_pane_changed(struct window *w) +{ + struct client *c; + + TAILQ_FOREACH(c, &clients, entry) { + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) + continue; + + control_write(c, "%%window-pane-changed @%u %%%u", w->id, + w->active->id); + } +} + +void control_notify_window_unlinked(__unused struct session *s, struct window *w) { struct client *c; @@ -154,15 +181,27 @@ control_notify_window_renamed(struct window *w) } void -control_notify_client_session_changed(struct client *c) +control_notify_client_session_changed(struct client *cc) { + struct client *c; struct session *s; - if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) + if (cc->session == NULL) return; - s = c->session; + s = cc->session; - control_write(c, "%%session-changed $%u %s", s->id, s->name); + TAILQ_FOREACH(c, &clients, entry) { + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) + continue; + + if (cc == c) { + control_write(c, "%%session-changed $%u %s", s->id, + s->name); + } else { + control_write(c, "%%client-session-changed %s $%u %s", + cc->name, s->id, s->name); + } + } } void @@ -203,3 +242,17 @@ control_notify_session_closed(__unused struct session *s) control_write(c, "%%sessions-changed"); } } + +void +control_notify_session_window_changed(struct session *s) +{ + struct client *c; + + TAILQ_FOREACH(c, &clients, entry) { + if (!CONTROL_SHOULD_NOTIFY_CLIENT(c)) + continue; + + control_write(c, "%%session-window-changed $%u @%u", s->id, + s->curw->window->id); + } +} |