aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <RyanDwyer@users.noreply.github.com>2018-08-02 08:17:25 +1000
committerGitHub <noreply@github.com>2018-08-02 08:17:25 +1000
commit4cc0855f21a2704314aa7b8973ceae7a8b463a1a (patch)
tree92d5b04c01c2da2bce20819ade8ed834bf2e420c /sway/tree/container.c
parentf078f7fdfa8c1b2549178b8137c6731c2fff6d3f (diff)
parent46cfa8ff56acff0139b2e24300cbc3ea19da723f (diff)
Merge pull request #2264 from ianyfan/ipc
IPC Events (1.0)
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) {
// TODO send ipc event type based on the container type
wl_signal_emit(&root_container.sway_root->events.new_container, container);
- if (container->type == C_VIEW || container->type == C_CONTAINER) {
+ if (container->type == C_VIEW) {
ipc_event_window(container, "new");
+ } else if (container->type == C_WORKSPACE) {
+ ipc_event_workspace(NULL, container, "init");
}
}
@@ -281,7 +283,7 @@ static struct sway_container *container_output_destroy(
container_remove_child(workspace);
if (!workspace_is_empty(workspace)) {
container_add_child(new_output, workspace);
- ipc_event_workspace(workspace, NULL, "move");
+ ipc_event_workspace(NULL, workspace, "move");
} else {
container_destroy(workspace);
}
@@ -319,7 +321,13 @@ static struct sway_container *container_destroy_noreaping(
}
wl_signal_emit(&con->events.destroy, con);
- ipc_event_window(con, "close");
+
+ // emit IPC event
+ if (con->type == C_VIEW) {
+ ipc_event_window(con, "close");
+ } else if (con->type == C_WORKSPACE) {
+ ipc_event_workspace(NULL, con, "empty");
+ }
// The below functions move their children to somewhere else.
if (con->type == C_OUTPUT) {