Use wl_resource_get_user_data for weston_surface resources
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
diff --git a/src/shell.c b/src/shell.c
index cfdb19c..d747bc1 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -985,7 +985,7 @@
{
struct desktop_shell *shell = resource->data;
struct weston_surface *surface =
- (struct weston_surface *) surface_resource;
+ wl_resource_get_user_data(surface_resource);
struct weston_surface *main_surface;
main_surface = weston_surface_get_main_surface(surface);
@@ -1668,7 +1668,8 @@
int x, int y, uint32_t flags)
{
struct shell_surface *shsurf = resource->data;
- struct weston_surface *parent = parent_resource->data;
+ struct weston_surface *parent =
+ wl_resource_get_user_data(parent_resource);
set_transient(shsurf, parent, x, y, flags);
}
@@ -2307,7 +2308,8 @@
uint32_t id,
struct wl_resource *surface_resource)
{
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
struct desktop_shell *shell = resource->data;
struct shell_surface *shsurf;
@@ -2434,7 +2436,8 @@
struct wl_resource *surface_resource)
{
struct desktop_shell *shell = resource->data;
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
if (surface->configure) {
wl_resource_post_error(surface_resource,
@@ -2467,7 +2470,8 @@
struct wl_resource *surface_resource)
{
struct desktop_shell *shell = resource->data;
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
if (surface->configure) {
wl_resource_post_error(surface_resource,
@@ -2521,7 +2525,8 @@
struct wl_resource *surface_resource)
{
struct desktop_shell *shell = resource->data;
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
shell->prepare_event_sent = false;
@@ -2585,7 +2590,7 @@
{
struct desktop_shell *shell = resource->data;
- shell->grab_surface = surface_resource->data;
+ shell->grab_surface = wl_resource_get_user_data(surface_resource);
}
static void
@@ -3667,7 +3672,8 @@
struct wl_resource *output_resource)
{
struct desktop_shell *shell = resource->data;
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
struct weston_output *output = output_resource->data;
surface->configure = screensaver_configure;
@@ -3865,7 +3871,8 @@
uint32_t id,
struct wl_resource *surface_resource)
{
- struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *surface =
+ wl_resource_get_user_data(surface_resource);
struct desktop_shell *shell = resource->data;
struct input_panel_surface *ipsurf;