diff options
author | Thomas Adam <thomas@xteddy.org> | 2014-04-24 12:59:00 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2014-04-24 12:59:00 +0100 |
commit | 3f54c9292fc8ee147d45256e430fbf85fab98128 (patch) | |
tree | afe1e1fe8ca82a88e7e6bbd94fb877f58c2e69c4 /control-notify.c | |
parent | 953c3ef47a1933d38308075c1bacc7ea8d38301b (diff) | |
parent | bec6c807cd580b003cd94b52a20caa2cbc7a0753 (diff) | |
download | rtmux-3f54c9292fc8ee147d45256e430fbf85fab98128.tar.gz rtmux-3f54c9292fc8ee147d45256e430fbf85fab98128.tar.bz2 rtmux-3f54c9292fc8ee147d45256e430fbf85fab98128.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'control-notify.c')
-rw-r--r-- | control-notify.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/control-notify.c b/control-notify.c index a298cdc5..4ea1570b 100644 --- a/control-notify.c +++ b/control-notify.c @@ -99,14 +99,19 @@ void control_notify_window_unlinked(unused struct session *s, struct window *w) { struct client *c; + struct session *cs; u_int i; for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; + cs = c->session; - control_write(c, "%%window-close @%u", w->id); + if (winlink_find_by_window_id(&cs->windows, w->id) != NULL) + control_write(c, "%%window-close @%u", w->id); + else + control_write(c, "%%unlinked-window-close @%u", w->id); } } @@ -134,14 +139,22 @@ void control_notify_window_renamed(struct window *w) { struct client *c; + struct session *cs; u_int i; for (i = 0; i < ARRAY_LENGTH(&clients); i++) { c = ARRAY_ITEM(&clients, i); if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; + cs = c->session; - control_write(c, "%%window-renamed @%u %s", w->id, w->name); + if (winlink_find_by_window_id(&cs->windows, w->id) != NULL) { + control_write(c, "%%window-renamed @%u %s", w->id, + w->name); + } else { + control_write(c, "%%unlinked-window-renamed @%u %s", + w->id, w->name); + } } } |