Use scene-graph helpers for sub-surfaces

Delegate sub-surface handling to wlr_scene_surface_tree_create.

References: https://github.com/swaywm/wlroots/pull/3128
This commit is contained in:
Simon Ser 2021-08-28 11:08:11 +02:00 committed by Jente Hidskes
parent fb3dc58237
commit 128fa90ea1
6 changed files with 16 additions and 95 deletions

8
seat.c
View file

@ -624,7 +624,7 @@ drag_icon_update_position(struct cg_drag_icon *drag_icon)
drag_icon_damage(drag_icon);
wlr_scene_node_set_position(&drag_icon->scene_surface->node, drag_icon->lx, drag_icon->ly);
wlr_scene_node_set_position(drag_icon->scene_node, drag_icon->lx, drag_icon->ly);
}
static void
@ -635,7 +635,7 @@ handle_drag_icon_destroy(struct wl_listener *listener, void *data)
drag_icon_damage(drag_icon);
wl_list_remove(&drag_icon->link);
wl_list_remove(&drag_icon->destroy.link);
wlr_scene_node_destroy(&drag_icon->scene_surface->node);
wlr_scene_node_destroy(drag_icon->scene_node);
free(drag_icon);
}
@ -678,8 +678,8 @@ handle_start_drag(struct wl_listener *listener, void *data)
}
drag_icon->seat = seat;
drag_icon->wlr_drag_icon = wlr_drag_icon;
drag_icon->scene_surface = wlr_scene_surface_create(&seat->server->scene->node, wlr_drag_icon->surface);
if (!drag_icon->scene_surface) {
drag_icon->scene_node = wlr_scene_subsurface_tree_create(&seat->server->scene->node, wlr_drag_icon->surface);
if (!drag_icon->scene_node) {
free(drag_icon);
return;
}