=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/control-notify.c,v retrieving revision 1.11 retrieving revision 1.12 diff -c -r1.11 -r1.12 *** src/usr.bin/tmux/control-notify.c 2015/04/24 23:17:11 1.11 --- src/usr.bin/tmux/control-notify.c 2015/11/13 10:00:26 1.12 *************** *** 1,4 **** ! /* $OpenBSD: control-notify.c,v 1.11 2015/04/24 23:17:11 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: control-notify.c,v 1.12 2015/11/13 10:00:26 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott *************** *** 19,24 **** --- 19,26 ---- #include + #include + #include "tmux.h" #define CONTROL_SHOULD_NOTIFY_CLIENT(c) \ *************** *** 65,71 **** --- 67,77 ---- struct format_tree *ft; struct winlink *wl; const char *template; + char *expanded; + template = "%layout-change #{window_id} #{window_layout} " + "#{window_visible_layout} #{window_flags}"; + TAILQ_FOREACH(c, &clients, entry) { if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) continue; *************** *** 81,93 **** */ if (w->layout_root == NULL) continue; - template = "%layout-change #{window_id} #{window_layout}"; ft = format_create(); wl = winlink_find_by_window(&s->windows, w); if (wl != NULL) { format_defaults(ft, c, NULL, wl, NULL); ! control_write(c, "%s", format_expand(ft, template)); } format_free(ft); } --- 87,100 ---- */ if (w->layout_root == NULL) continue; ft = format_create(); wl = winlink_find_by_window(&s->windows, w); if (wl != NULL) { format_defaults(ft, c, NULL, wl, NULL); ! expanded = format_expand(ft, template); ! control_write(c, "%s", expanded); ! free(expanded); } format_free(ft); }