diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 12 |
1 files changed, 9 insertions, 3 deletions
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 @@ | |||
15 | #include "sway/server.h" | 15 | #include "sway/server.h" |
16 | #include "sway/view.h" | 16 | #include "sway/view.h" |
17 | #include "sway/workspace.h" | 17 | #include "sway/workspace.h" |
18 | #include "sway/ipc-server.h" | ||
18 | #include "log.h" | 19 | #include "log.h" |
19 | 20 | ||
20 | static list_t *bfs_queue; | 21 | static list_t *bfs_queue; |
@@ -32,6 +33,11 @@ static list_t *get_bfs_queue() { | |||
32 | return bfs_queue; | 33 | return bfs_queue; |
33 | } | 34 | } |
34 | 35 | ||
36 | static void notify_new_container(swayc_t *container) { | ||
37 | wl_signal_emit(&root_container.sway_root->events.new_container, container); | ||
38 | ipc_event_window(container, "new"); | ||
39 | } | ||
40 | |||
35 | swayc_t *swayc_by_test(swayc_t *container, | 41 | swayc_t *swayc_by_test(swayc_t *container, |
36 | bool (*test)(swayc_t *view, void *data), void *data) { | 42 | bool (*test)(swayc_t *view, void *data), void *data) { |
37 | if (!container->children) { | 43 | if (!container->children) { |
@@ -175,7 +181,7 @@ swayc_t *new_output(struct sway_output *sway_output) { | |||
175 | } | 181 | } |
176 | 182 | ||
177 | free(ws_name); | 183 | free(ws_name); |
178 | wl_signal_emit(&root_container.sway_root->events.new_container, output); | 184 | notify_new_container(output); |
179 | return output; | 185 | return output; |
180 | } | 186 | } |
181 | 187 | ||
@@ -197,7 +203,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { | |||
197 | 203 | ||
198 | add_child(output, workspace); | 204 | add_child(output, workspace); |
199 | sort_workspaces(output); | 205 | sort_workspaces(output); |
200 | wl_signal_emit(&root_container.sway_root->events.new_container, workspace); | 206 | notify_new_container(workspace); |
201 | return workspace; | 207 | return workspace; |
202 | } | 208 | } |
203 | 209 | ||
@@ -222,7 +228,7 @@ swayc_t *new_view(swayc_t *sibling, struct sway_view *sway_view) { | |||
222 | // Regular case, create as sibling of current container | 228 | // Regular case, create as sibling of current container |
223 | add_sibling(sibling, swayc); | 229 | add_sibling(sibling, swayc); |
224 | } | 230 | } |
225 | wl_signal_emit(&root_container.sway_root->events.new_container, swayc); | 231 | notify_new_container(swayc); |
226 | return swayc; | 232 | return swayc; |
227 | } | 233 | } |
228 | 234 | ||