aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-04-04 18:52:38 -0400
committerTony Crisci <tony@dubstepdish.com>2018-04-04 18:52:38 -0400
commit3e61718053a7e2cdd94c64f5613c6bdf28e35c8e (patch)
tree4cceb8836dbc34317c8e530aec373fd6241db466 /sway/tree/container.c
parent3852a710ca62a76f4fd9c6ff9d28e7e5d5fcf78d (diff)
try to fix focus-inactive
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 753f333c..b47a8364 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -51,12 +51,18 @@ const char *container_type_to_str(enum sway_container_type type) {
}
void container_create_notify(struct sway_container *container) {
+ if (container->type != C_VIEW || container->type != C_CONTAINER) {
+ return;
+ }
// TODO send ipc event type based on the container type
wl_signal_emit(&root_container.sway_root->events.new_container, container);
ipc_event_window(container, "new");
}
static void container_close_notify(struct sway_container *container) {
+ if (container == NULL) {
+ return;
+ }
// TODO send ipc event type based on the container type
ipc_event_window(container, "close");
}
@@ -522,8 +528,8 @@ static bool find_child_func(struct sway_container *con, void *data) {
bool container_has_child(struct sway_container *con,
struct sway_container *child) {
- if (child == NULL || child->type == C_VIEW ||
- child->children->length == 0) {
+ if (con == NULL || con->type == C_VIEW ||
+ con->children->length == 0) {
return false;
}
return container_find(con, find_child_func, child);