aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-31 15:22:10 -0400
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-03-31 15:38:59 -0400
commit6f7b33e6919b2a8467ea1638ee56ac0232408793 (patch)
tree400a88da660080c18c463edff127fa1e27a719c2 /sway/tree/container.c
parentreap container parent on destroy (diff)
downloadsway-6f7b33e6919b2a8467ea1638ee56ac0232408793.tar.gz
sway-6f7b33e6919b2a8467ea1638ee56ac0232408793.tar.zst
sway-6f7b33e6919b2a8467ea1638ee56ac0232408793.zip
handle container destroy in the seat
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index f972ac24..e2fe9e7c 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -401,3 +401,16 @@ bool container_has_anscestor(struct sway_container *descendant,
401 } 401 }
402 return false; 402 return false;
403} 403}
404
405bool find_child_func(struct sway_container *con, void *data) {
406 struct sway_container *child = data;
407 return con == child;
408}
409
410bool container_has_child(struct sway_container *con,
411 struct sway_container *child) {
412 if (child->type == C_VIEW || child->children->length == 0) {
413 return false;
414 }
415 return container_find(con, find_child_func, child);
416}