mirror of
https://github.com/swaywm/sway.git
synced 2026-04-23 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
|
|
@ -791,6 +791,8 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
|
|||
wl_list_remove(&output->mode.link);
|
||||
wl_list_remove(&output->present.link);
|
||||
|
||||
wlr_scene_output_destroy(output->scene_output);
|
||||
output->scene_output = NULL;
|
||||
output->wlr_output->data = NULL;
|
||||
output->wlr_output = NULL;
|
||||
|
||||
|
|
@ -898,11 +900,24 @@ void handle_new_output(struct wl_listener *listener, void *data) {
|
|||
return;
|
||||
}
|
||||
|
||||
struct sway_output *output = output_create(wlr_output);
|
||||
if (!output) {
|
||||
// Create the scene output here so we're not accidentally creating one for
|
||||
// the fallback output
|
||||
struct wlr_scene_output *scene_output =
|
||||
wlr_scene_output_create(root->root_scene, wlr_output);
|
||||
if (!scene_output) {
|
||||
sway_log(SWAY_ERROR, "Failed to create a scene output");
|
||||
return;
|
||||
}
|
||||
|
||||
struct sway_output *output = output_create(wlr_output);
|
||||
if (!output) {
|
||||
sway_log(SWAY_ERROR, "Failed to create a sway output");
|
||||
wlr_scene_output_destroy(scene_output);
|
||||
return;
|
||||
}
|
||||
|
||||
output->server = server;
|
||||
output->scene_output = scene_output;
|
||||
output->damage = wlr_output_damage_create(wlr_output);
|
||||
|
||||
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue