handle container destroy in the seat

This commit is contained in:
Tony Crisci 2018-03-31 15:22:10 -04:00
parent e7ecb001d7
commit 6f7b33e691
3 changed files with 88 additions and 32 deletions

View file

@ -401,3 +401,16 @@ bool container_has_anscestor(struct sway_container *descendant,
}
return false;
}
bool find_child_func(struct sway_container *con, void *data) {
struct sway_container *child = data;
return con == child;
}
bool container_has_child(struct sway_container *con,
struct sway_container *child) {
if (child->type == C_VIEW || child->children->length == 0) {
return false;
}
return container_find(con, find_child_func, child);
}