wayland/surface: Add getter for the surface wl_resource

Meant to avoid dereferencing the MetaWaylandSurface struct directly.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2810>
This commit is contained in:
Jonas Ådahl 2023-01-27 21:45:35 +01:00 committed by Marge Bot
parent 5d888f2df6
commit a2f93e76a3
2 changed files with 9 additions and 0 deletions

View File

@ -2323,3 +2323,9 @@ meta_wayland_surface_get_geometry_scale (MetaWaylandSurface *surface)
actor_surface = META_WAYLAND_ACTOR_SURFACE (surface->role);
return meta_wayland_actor_surface_get_geometry_scale (actor_surface);
}
struct wl_resource *
meta_wayland_surface_get_resource (MetaWaylandSurface *surface)
{
return surface->resource;
}

View File

@ -393,6 +393,9 @@ meta_wayland_surface_can_scanout_untransformed (MetaWaylandSurface *surface,
int meta_wayland_surface_get_geometry_scale (MetaWaylandSurface *surface);
META_EXPORT_TEST
struct wl_resource * meta_wayland_surface_get_resource (MetaWaylandSurface *surface);
static inline MetaWaylandSurfaceState *
meta_wayland_surface_state_new (void)
{