diff options
author | Alexander Orzechowski <alex@ozal.ski> | 2024-01-18 10:00:45 -0500 |
---|---|---|
committer | Kirill Primak <vyivel@eclair.cafe> | 2024-01-18 18:36:54 +0300 |
commit | 1eb16d136774c8fb3c9085df45156264f0db8814 (patch) | |
tree | 9c348ab37edae50b76a388d7e8d8dcd011cea33b /sway/tree/view.c | |
parent | view: init function should return a success bool (diff) | |
download | sway-1eb16d136774c8fb3c9085df45156264f0db8814.tar.gz sway-1eb16d136774c8fb3c9085df45156264f0db8814.tar.zst sway-1eb16d136774c8fb3c9085df45156264f0db8814.zip |
scene_graph: Maintain `wlr_scene_node`s for the sway tree.
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index d62a0667..bc968edc 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -37,6 +37,14 @@ | |||
37 | 37 | ||
38 | bool view_init(struct sway_view *view, enum sway_view_type type, | 38 | bool view_init(struct sway_view *view, enum sway_view_type type, |
39 | const struct sway_view_impl *impl) { | 39 | const struct sway_view_impl *impl) { |
40 | bool failed = false; | ||
41 | view->scene_tree = alloc_scene_tree(root->staging, &failed); | ||
42 | view->content_tree = alloc_scene_tree(view->scene_tree, &failed); | ||
43 | if (failed) { | ||
44 | wlr_scene_node_destroy(&view->scene_tree->node); | ||
45 | return false; | ||
46 | } | ||
47 | |||
40 | view->type = type; | 48 | view->type = type; |
41 | view->impl = impl; | 49 | view->impl = impl; |
42 | view->executed_criteria = create_list(); | 50 | view->executed_criteria = create_list(); |
@@ -67,7 +75,7 @@ void view_destroy(struct sway_view *view) { | |||
67 | list_free(view->executed_criteria); | 75 | list_free(view->executed_criteria); |
68 | 76 | ||
69 | view_assign_ctx(view, NULL); | 77 | view_assign_ctx(view, NULL); |
70 | 78 | wlr_scene_node_destroy(&view->scene_tree->node); | |
71 | free(view->title_format); | 79 | free(view->title_format); |
72 | 80 | ||
73 | if (view->impl->destroy) { | 81 | if (view->impl->destroy) { |