};
/* Public SSD API */
-void ssd_create(struct view *view);
+void ssd_create(struct view *view, bool active);
void ssd_set_active(struct view *view, bool active);
void ssd_update_title(struct view *view);
void ssd_update_geometry(struct view *view);
}
void
-ssd_create(struct view *view)
+ssd_create(struct view *view, bool active)
{
- bool is_active = view->server->focused_view == view;
-
- if (view->ssd.tree) {
- ssd_set_active(view, is_active);
- return;
- }
+ assert(!view->ssd.tree);
view->ssd.tree = wlr_scene_tree_create(view->scene_tree);
wlr_scene_node_lower_to_bottom(&view->ssd.tree->node);
ssd_border_create(view);
ssd_titlebar_create(view);
view->ssd.margin = ssd_thickness(view);
- ssd_set_active(view, is_active);
+ ssd_set_active(view, active);
}
void
assert(view);
if (view->ssd_enabled != decorations && !view->fullscreen) {
if (decorations) {
- ssd_create(view);
+ ssd_create(view, view == view->server->focused_view);
} else {
ssd_destroy(view);
}
assert(view);
if (view->ssd_enabled) {
ssd_destroy(view);
- ssd_create(view);
+ ssd_create(view, view == view->server->focused_view);
}
}