From 531869bd92f0daff3cc3c3cc0ab273846f411dc8 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 13 Nov 2015 10:00:26 +0000 Subject: Add window_visible_layout which ignores zoomed panes and use it for control mode (which needs to know all panes), from George Nachman. --- control-notify.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'control-notify.c') diff --git a/control-notify.c b/control-notify.c index 943d670c..16a98e3a 100644 --- a/control-notify.c +++ b/control-notify.c @@ -19,6 +19,8 @@ #include +#include + #include "tmux.h" #define CONTROL_SHOULD_NOTIFY_CLIENT(c) \ @@ -65,6 +67,10 @@ control_notify_window_layout_changed(struct window *w) 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) @@ -81,13 +87,14 @@ control_notify_window_layout_changed(struct window *w) */ 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)); + expanded = format_expand(ft, template); + control_write(c, "%s", expanded); + free(expanded); } format_free(ft); } -- cgit v1.2.3