From 02804584e518fdf38e82eacedbe7606a87f004fc Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 27 Feb 2018 19:53:15 -0500 Subject: ipc new window event --- sway/tree/container.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sway/tree') diff --git a/sway/tree/container.c b/sway/tree/container.c index fafbdb03..b424dd0a 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -15,6 +15,7 @@ #include "sway/server.h" #include "sway/view.h" #include "sway/workspace.h" +#include "sway/ipc-server.h" #include "log.h" static list_t *bfs_queue; @@ -32,6 +33,11 @@ static list_t *get_bfs_queue() { return bfs_queue; } +static void notify_new_container(swayc_t *container) { + wl_signal_emit(&root_container.sway_root->events.new_container, container); + ipc_event_window(container, "new"); +} + swayc_t *swayc_by_test(swayc_t *container, bool (*test)(swayc_t *view, void *data), void *data) { if (!container->children) { @@ -175,7 +181,7 @@ swayc_t *new_output(struct sway_output *sway_output) { } free(ws_name); - wl_signal_emit(&root_container.sway_root->events.new_container, output); + notify_new_container(output); return output; } @@ -197,7 +203,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { add_child(output, workspace); sort_workspaces(output); - wl_signal_emit(&root_container.sway_root->events.new_container, workspace); + notify_new_container(workspace); return workspace; } @@ -222,7 +228,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) { // Regular case, create as sibling of current container add_sibling(sibling, swayc); } - wl_signal_emit(&root_container.sway_root->events.new_container, swayc); + notify_new_container(swayc); return swayc; } -- cgit v1.2.3