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 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) { | |||
53 | void container_create_notify(struct sway_container *container) { | 53 | void 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 | ||
59 | static void container_close_notify(struct sway_container *container) { | 62 | static 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 | ||
507 | bool container_has_child(struct sway_container *con, | 513 | bool 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); |