aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 4e85021d..b6ff4d30 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -62,8 +62,10 @@ void container_create_notify(struct sway_container *container) {
62 // TODO send ipc event type based on the container type 62 // TODO send ipc event type based on the container type
63 wl_signal_emit(&root_container.sway_root->events.new_container, container); 63 wl_signal_emit(&root_container.sway_root->events.new_container, container);
64 64
65 if (container->type == C_VIEW || container->type == C_CONTAINER) { 65 if (container->type == C_VIEW) {
66 ipc_event_window(container, "new"); 66 ipc_event_window(container, "new");
67 } else if (container->type == C_WORKSPACE) {
68 ipc_event_workspace(NULL, container, "init");
67 } 69 }
68} 70}
69 71
@@ -281,7 +283,7 @@ static struct sway_container *container_output_destroy(
281 container_remove_child(workspace); 283 container_remove_child(workspace);
282 if (!workspace_is_empty(workspace)) { 284 if (!workspace_is_empty(workspace)) {
283 container_add_child(new_output, workspace); 285 container_add_child(new_output, workspace);
284 ipc_event_workspace(workspace, NULL, "move"); 286 ipc_event_workspace(NULL, workspace, "move");
285 } else { 287 } else {
286 container_destroy(workspace); 288 container_destroy(workspace);
287 } 289 }
@@ -319,7 +321,13 @@ static struct sway_container *container_destroy_noreaping(
319 } 321 }
320 322
321 wl_signal_emit(&con->events.destroy, con); 323 wl_signal_emit(&con->events.destroy, con);
322 ipc_event_window(con, "close"); 324
325 // emit IPC event
326 if (con->type == C_VIEW) {
327 ipc_event_window(con, "close");
328 } else if (con->type == C_WORKSPACE) {
329 ipc_event_workspace(NULL, con, "empty");
330 }
323 331
324 // The below functions move their children to somewhere else. 332 // The below functions move their children to somewhere else.
325 if (con->type == C_OUTPUT) { 333 if (con->type == C_OUTPUT) {