aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-11-25 16:30:15 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2017-11-25 16:30:15 -0500
commit8caabe59c2e6f6174678e6c28be3381a7dabff10 (patch)
tree5425efb1f3b68e9b275d8429bba70a2b132b72c9 /sway/tree/layout.c
parentFix rendering issues, wire up some xdg listeners (diff)
downloadsway-8caabe59c2e6f6174678e6c28be3381a7dabff10.tar.gz
sway-8caabe59c2e6f6174678e6c28be3381a7dabff10.tar.zst
sway-8caabe59c2e6f6174678e6c28be3381a7dabff10.zip
Handle view destruction properly
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 6e2586a7..ea7bb8bb 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -40,6 +40,19 @@ void add_child(swayc_t *parent, swayc_t *child) {
40 */ 40 */
41} 41}
42 42
43swayc_t *remove_child(swayc_t *child) {
44 int i;
45 swayc_t *parent = child->parent;
46 for (i = 0; i < parent->children->length; ++i) {
47 if (parent->children->items[i] == child) {
48 list_del(parent->children, i);
49 break;
50 }
51 }
52 child->parent = NULL;
53 return parent;
54}
55
43enum swayc_layouts default_layout(swayc_t *output) { 56enum swayc_layouts default_layout(swayc_t *output) {
44 /* TODO WLR 57 /* TODO WLR
45 if (config->default_layout != L_NONE) { 58 if (config->default_layout != L_NONE) {