Handle view destruction properly

This commit is contained in:
Drew DeVault 2017-11-25 16:30:15 -05:00
parent a57d462926
commit 8caabe59c2
6 changed files with 73 additions and 2 deletions

View file

@ -40,6 +40,19 @@ void add_child(swayc_t *parent, swayc_t *child) {
*/
}
swayc_t *remove_child(swayc_t *child) {
int i;
swayc_t *parent = child->parent;
for (i = 0; i < parent->children->length; ++i) {
if (parent->children->items[i] == child) {
list_del(parent->children, i);
break;
}
}
child->parent = NULL;
return parent;
}
enum swayc_layouts default_layout(swayc_t *output) {
/* TODO WLR
if (config->default_layout != L_NONE) {