[mutter] wayland: Clean up surface creation
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland: Clean up surface creation
- Date: Tue, 22 Apr 2014 22:28:31 +0000 (UTC)
commit 59fc9d832bda59c7bf0e25bc5ca724b68816806a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Apr 22 18:22:13 2014 -0400
wayland: Clean up surface creation
src/wayland/meta-wayland-surface.c | 9 +++++----
src/wayland/meta-wayland-surface.h | 7 +++----
src/wayland/meta-wayland.c | 11 ++++-------
3 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index e9f68e7..e4d3cb8 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 537f4f2..fc744e8 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 0cced23..7e8989e 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]