From a2f93e76a3e98da48ae726a45a9e4b7a6b3e2562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 27 Jan 2023 21:45:35 +0100 Subject: [PATCH] wayland/surface: Add getter for the surface wl_resource Meant to avoid dereferencing the MetaWaylandSurface struct directly. Part-of: --- src/wayland/meta-wayland-surface.c | 6 ++++++ src/wayland/meta-wayland-surface.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 79bd5cd44..eaf7346d6 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -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; +} diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 9cb6277c7..339a71715 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -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) {