diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index e9f68e725..e4d3cb8c0 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -568,15 +568,16 @@ wl_surface_destructor (struct wl_resource *resource) MetaWaylandSurface * meta_wayland_surface_create (MetaWaylandCompositor *compositor, - struct wl_client *client, - guint32 id, - guint32 version) + struct wl_client *client, + struct wl_resource *compositor_resource, + guint32 id) { MetaWaylandSurface *surface = g_slice_new0 (MetaWaylandSurface); surface->compositor = compositor; - surface->resource = wl_resource_create (client, &wl_surface_interface, version, id); + surface->resource = wl_resource_create (client, &wl_surface_interface, + MIN (META_WL_SURFACE_VERSION, wl_resource_get_version (compositor_resource)), id); wl_resource_set_implementation (surface->resource, &meta_wayland_wl_surface_interface, surface, wl_surface_destructor); surface->buffer_destroy_listener.notify = surface_handle_buffer_destroy; diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h index 537f4f20a..fc744e81e 100644 --- a/src/wayland/meta-wayland-surface.h +++ b/src/wayland/meta-wayland-surface.h @@ -115,9 +115,9 @@ struct _MetaWaylandSurface void meta_wayland_shell_init (MetaWaylandCompositor *compositor); MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *compositor, - struct wl_client *client, - guint32 id, - guint32 version); + struct wl_client *client, + struct wl_resource *compositor_resource, + guint32 id); void meta_wayland_surface_set_window (MetaWaylandSurface *surface, MetaWindow *window); @@ -139,5 +139,4 @@ void meta_wayland_surface_delete (MetaWaylandSurface *surface); void meta_wayland_surface_popup_done (MetaWaylandSurface *surface); - #endif diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 0cced23e6..7e8989e8b 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -199,16 +199,13 @@ meta_wayland_compositor_repick (MetaWaylandCompositor *compositor) } static void -meta_wayland_compositor_create_surface (struct wl_client *wayland_client, - struct wl_resource *wayland_compositor_resource, +meta_wayland_compositor_create_surface (struct wl_client *client, + struct wl_resource *resource, guint32 id) { - MetaWaylandCompositor *compositor = - wl_resource_get_user_data (wayland_compositor_resource); + MetaWaylandCompositor *compositor = wl_resource_get_user_data (resource); - meta_wayland_surface_create (compositor, wayland_client, id, - MIN (META_WL_SURFACE_VERSION, - wl_resource_get_version (wayland_compositor_resource))); + meta_wayland_surface_create (compositor, client, resource, id); } static void