=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/control-notify.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/tmux/control-notify.c 2017/03/08 13:36:12 1.20 --- src/usr.bin/tmux/control-notify.c 2017/05/04 07:16:43 1.21 *************** *** 1,4 **** ! /* $OpenBSD: control-notify.c,v 1.20 2017/03/08 13:36:12 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: control-notify.c,v 1.21 2017/05/04 07:16:43 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott *************** *** 60,72 **** } void control_notify_window_layout_changed(struct window *w) { ! 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}"; --- 60,85 ---- } 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; template = "%layout-change #{window_id} #{window_layout} " "#{window_visible_layout} #{window_flags}"; *************** *** 97,102 **** --- 110,129 ---- } 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,168 **** } void ! control_notify_client_session_changed(struct client *c) { struct session *s; ! if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) return; ! s = c->session; ! control_write(c, "%%session-changed $%u %s", s->id, s->name); } void --- 181,207 ---- } void ! control_notify_client_session_changed(struct client *cc) { + struct client *c; struct session *s; ! if (cc->session == NULL) return; ! s = cc->session; ! 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 *************** *** 201,205 **** --- 240,258 ---- continue; 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); } }