diff options
Diffstat (limited to 'include/sway/tree/node.h')
-rw-r--r-- | include/sway/tree/node.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/sway/tree/node.h b/include/sway/tree/node.h index 470ee3b5..e2dbcdf0 100644 --- a/include/sway/tree/node.h +++ b/include/sway/tree/node.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _SWAY_NODE_H | 1 | #ifndef _SWAY_NODE_H |
2 | #define _SWAY_NODE_H | 2 | #define _SWAY_NODE_H |
3 | #include <wayland-server-core.h> | ||
3 | #include <stdbool.h> | 4 | #include <stdbool.h> |
5 | #include <wlr/types/wlr_scene.h> | ||
4 | #include "list.h" | 6 | #include "list.h" |
5 | 7 | ||
6 | #define MIN_SANE_W 100 | 8 | #define MIN_SANE_W 100 |
@@ -74,4 +76,15 @@ list_t *node_get_children(struct sway_node *node); | |||
74 | 76 | ||
75 | bool node_has_ancestor(struct sway_node *node, struct sway_node *ancestor); | 77 | bool node_has_ancestor(struct sway_node *node, struct sway_node *ancestor); |
76 | 78 | ||
79 | // when destroying a sway tree, it's not known which order the tree will be | ||
80 | // destroyed. To prevent freeing of scene_nodes recursing up the tree, | ||
81 | // let's use this helper function to disown them to the staging node. | ||
82 | void scene_node_disown_children(struct wlr_scene_tree *tree); | ||
83 | |||
84 | // a helper function used to allocate tree nodes. If an allocation failure | ||
85 | // occurs a flag is flipped that can be checked later to destroy a parent | ||
86 | // of this scene node preventing memory leaks. | ||
87 | struct wlr_scene_tree *alloc_scene_tree(struct wlr_scene_tree *parent, | ||
88 | bool *failed); | ||
89 | |||
77 | #endif | 90 | #endif |