diff options
Diffstat (limited to 'control-notify.c')
-rw-r--r-- | control-notify.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/control-notify.c b/control-notify.c index a298cdc5..747ef5b4 100644 --- a/control-notify.c +++ b/control-notify.c @@ -88,7 +88,7 @@ control_notify_window_layout_changed(struct window *w) ft = format_create(); wl = winlink_find_by_window(&s->windows, w); if (wl != NULL) { - format_winlink(ft, c->session, wl); + format_defaults(ft, c, NULL, wl, NULL); control_write(c, "%s", format_expand(ft, template)); } format_free(ft); @@ -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); + } } } |