summaryrefslogtreecommitdiffstats
path: root/control-notify.c
diff options
context:
space:
mode:
authornicm <nicm>2015-11-13 10:00:26 +0000
committernicm <nicm>2015-11-13 10:00:26 +0000
commit531869bd92f0daff3cc3c3cc0ab273846f411dc8 (patch)
tree717a58746a90959470f7247dc490eb7f295933fb /control-notify.c
parentc5689a5a4031a43769b8b721cafa6d1eab6abc44 (diff)
Add window_visible_layout which ignores zoomed panes and use it for
control mode (which needs to know all panes), from George Nachman.
Diffstat (limited to 'control-notify.c')
-rw-r--r--control-notify.c11
1 files changed, 9 insertions, 2 deletions
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 <sys/types.h>
+#include <stdlib.h>
+
#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);
}