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

12
view.h
View file

@ -26,15 +26,13 @@ struct cg_view {
struct wl_list link; // server::views
struct wl_list children; // cg_view_child::link
struct wlr_surface *wlr_surface;
struct wlr_scene_surface *scene_surface;
struct wlr_scene_node *scene_node;
/* The view has a position in layout coordinates. */
int lx, ly;
enum cg_view_type type;
const struct cg_view_impl *impl;
struct wl_listener new_subsurface;
};
struct cg_view_impl {
@ -53,18 +51,10 @@ struct cg_view_child {
struct wl_list link;
struct wl_listener commit;
struct wl_listener new_subsurface;
void (*destroy)(struct cg_view_child *child);
};
struct cg_subsurface {
struct cg_view_child view_child;
struct wlr_subsurface *wlr_subsurface;
struct wl_listener destroy;
};
char *view_get_title(struct cg_view *view);
bool view_is_primary(struct cg_view *view);
bool view_is_transient_for(struct cg_view *child, struct cg_view *parent);