mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
scene_graph: Maintain wlr_scene_nodes for the sway tree.
This commit is contained in:
parent
a33ede4c43
commit
25da7b237d
13 changed files with 286 additions and 6 deletions
|
|
@ -69,6 +69,18 @@ struct sway_workspace *workspace_create(struct sway_output *output,
|
|||
return NULL;
|
||||
}
|
||||
node_init(&ws->node, N_WORKSPACE, ws);
|
||||
|
||||
bool alloc_failure = false;
|
||||
ws->layers.tiling = alloc_scene_tree(root->staging, &alloc_failure);
|
||||
ws->layers.fullscreen = alloc_scene_tree(root->staging, &alloc_failure);
|
||||
|
||||
if (alloc_failure) {
|
||||
wlr_scene_node_destroy(&ws->layers.tiling->node);
|
||||
wlr_scene_node_destroy(&ws->layers.fullscreen->node);
|
||||
free(ws);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ws->name = name ? strdup(name) : NULL;
|
||||
ws->prev_split_layout = L_NONE;
|
||||
ws->layout = output_get_default_layout(output);
|
||||
|
|
@ -129,6 +141,11 @@ void workspace_destroy(struct sway_workspace *workspace) {
|
|||
return;
|
||||
}
|
||||
|
||||
scene_node_disown_children(workspace->layers.tiling);
|
||||
scene_node_disown_children(workspace->layers.fullscreen);
|
||||
wlr_scene_node_destroy(&workspace->layers.tiling->node);
|
||||
wlr_scene_node_destroy(&workspace->layers.fullscreen->node);
|
||||
|
||||
free(workspace->name);
|
||||
free(workspace->representation);
|
||||
list_free_items_and_destroy(workspace->output_priority);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue