Change weston_surface.resource to a wl_resource pointer.
This is the first in what will be a series of weston patches to convert
instances of wl_resource to pointers so we can make wl_resource opaque.
This patch handles weston_surface and should be the most invasive of the
entire series. I am sending this one out ahead of the rest for review.
Specifically, my machine is not set up to build XWayland so I have no
ability to test it fully. Could someone please test with XWayland and let
me know if this causes problems?
Because a surface may be created from XWayland, the resource may not always
exist. Therefore, a destroy signal was added to weston_surface and
everything used to listen to surface->resource.destroy_signal now listens
to surface->destroy_signal.
diff --git a/src/zoom.c b/src/zoom.c
index 292aed6..ec9db98 100644
--- a/src/zoom.c
+++ b/src/zoom.c
@@ -40,7 +40,10 @@
struct wl_resource *surface_resource,
wl_fixed_t x, wl_fixed_t y)
{
- weston_text_cursor_position_notify((struct weston_surface *) surface_resource, x, y);
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
+
+ weston_text_cursor_position_notify(surface, x, y);
}
struct text_cursor_position_interface text_cursor_position_implementation = {