summaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index bd9f1edf..8fc9e3e8 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -53,10 +53,16 @@ const char *container_type_to_str(enum sway_container_type type) {
53void container_create_notify(struct sway_container *container) { 53void container_create_notify(struct sway_container *container) {
54 // TODO send ipc event type based on the container type 54 // TODO send ipc event type based on the container type
55 wl_signal_emit(&root_container.sway_root->events.new_container, container); 55 wl_signal_emit(&root_container.sway_root->events.new_container, container);
56 ipc_event_window(container, "new"); 56
57 if (container->type == C_VIEW || container->type == C_CONTAINER) {
58 ipc_event_window(container, "new");
59 }
57} 60}
58 61
59static void container_close_notify(struct sway_container *container) { 62static void container_close_notify(struct sway_container *container) {
63 if (container == NULL) {
64 return;
65 }
60 // TODO send ipc event type based on the container type 66 // TODO send ipc event type based on the container type
61 ipc_event_window(container, "close"); 67 ipc_event_window(container, "close");
62} 68}
@@ -506,8 +512,8 @@ static bool find_child_func(struct sway_container *con, void *data) {
506 512
507bool container_has_child(struct sway_container *con, 513bool container_has_child(struct sway_container *con,
508 struct sway_container *child) { 514 struct sway_container *child) {
509 if (child == NULL || child->type == C_VIEW || 515 if (con == NULL || con->type == C_VIEW ||
510 child->children->length == 0) { 516 con->children->length == 0) {
511 return false; 517 return false;
512 } 518 }
513 return container_find(con, find_child_func, child); 519 return container_find(con, find_child_func, child);