1
0
Fork 0

wayland: Clean up surface creation

This commit is contained in:
Jasper St. Pierre 2014-04-22 18:22:13 -04:00
parent 0bf5c831d5
commit 59fc9d832b
3 changed files with 12 additions and 15 deletions

View file

@ -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;

View file

@ -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

View file

@ -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