struct wlr_scene_tree *parent;
FOR_EACH_STATE(ssd, subtree) {
- if (subtree == &ssd->shadow.active) {
+ wl_list_init(&subtree->parts);
+
+ if (!rc.shadows_enabled) {
+ /* Shadows are globally disabled */
+ continue;
+ } else if (subtree == &ssd->shadow.active) {
if (theme->window_active_shadow_size == 0) {
/* Active window shadows are disabled */
continue;
corner_bottom_buffer = &theme->shadow_corner_bottom_inactive->base;
edge_buffer = &theme->shadow_edge_inactive->base;
}
- wl_list_init(&subtree->parts);
make_shadow(&subtree->parts,
LAB_SSD_PART_CORNER_BOTTOM_RIGHT, parent,
assert(ssd);
assert(ssd->shadow.tree);
+ struct ssd_sub_tree *subtree;
+ FOR_EACH_STATE(ssd, subtree) {
+ ssd_destroy_parts(&subtree->parts);
+ /*
+ * subtree->tree will be destroyed when its
+ * parent (ssd->shadow.tree) is destroyed.
+ */
+ subtree->tree = NULL;
+ } FOR_EACH_END
+
wlr_scene_node_destroy(&ssd->shadow.tree->node);
ssd->shadow.tree = NULL;
}