version 1.11, 2015/04/24 23:17:11 |
version 1.12, 2015/11/13 10:00:26 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
|
|
|
#include <stdlib.h> |
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
#define CONTROL_SHOULD_NOTIFY_CLIENT(c) \ |
#define CONTROL_SHOULD_NOTIFY_CLIENT(c) \ |
|
|
struct format_tree *ft; |
struct format_tree *ft; |
struct winlink *wl; |
struct winlink *wl; |
const char *template; |
const char *template; |
|
char *expanded; |
|
|
|
template = "%layout-change #{window_id} #{window_layout} " |
|
"#{window_visible_layout} #{window_flags}"; |
|
|
TAILQ_FOREACH(c, &clients, entry) { |
TAILQ_FOREACH(c, &clients, entry) { |
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) |
if (!CONTROL_SHOULD_NOTIFY_CLIENT(c) || c->session == NULL) |
continue; |
continue; |
|
|
*/ |
*/ |
if (w->layout_root == NULL) |
if (w->layout_root == NULL) |
continue; |
continue; |
template = "%layout-change #{window_id} #{window_layout}"; |
|
|
|
ft = format_create(); |
ft = format_create(); |
wl = winlink_find_by_window(&s->windows, w); |
wl = winlink_find_by_window(&s->windows, w); |
if (wl != NULL) { |
if (wl != NULL) { |
format_defaults(ft, c, NULL, 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); |
format_free(ft); |
} |
} |