[mutter] wayland: Simplify global version management



commit 75b6e917ad03b9af1f855cb30469c36116e96d2c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Aug 4 10:24:59 2014 -0400

    wayland: Simplify global version management
    
    libwayland-server already checks the bounds of the bind for versioning,
    meaning that the value that we pass to wl_global_create is all we need.

 src/wayland/meta-wayland-data-device.c |    4 +---
 src/wayland/meta-wayland-outputs.c     |    3 +--
 src/wayland/meta-wayland-seat.c        |    3 +--
 src/wayland/meta-wayland-surface.c     |   11 ++++-------
 src/wayland/meta-wayland.c             |    3 +--
 5 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/src/wayland/meta-wayland-data-device.c b/src/wayland/meta-wayland-data-device.c
index 85ab76c..60d1c8c 100644
--- a/src/wayland/meta-wayland-data-device.c
+++ b/src/wayland/meta-wayland-data-device.c
@@ -508,9 +508,7 @@ bind_manager (struct wl_client *client,
               void *data, guint32 version, guint32 id)
 {
   struct wl_resource *resource;
-
-  resource = wl_resource_create (client, &wl_data_device_manager_interface,
-                                MIN (version, META_WL_DATA_DEVICE_MANAGER_VERSION), id);
+  resource = wl_resource_create (client, &wl_data_device_manager_interface, version, id);
   wl_resource_set_implementation (resource, &manager_interface, NULL, NULL);
 }
 
diff --git a/src/wayland/meta-wayland-outputs.c b/src/wayland/meta-wayland-outputs.c
index dd2c76c..f2caf31 100644
--- a/src/wayland/meta-wayland-outputs.c
+++ b/src/wayland/meta-wayland-outputs.c
@@ -102,8 +102,7 @@ bind_output (struct wl_client *client,
   struct wl_resource *resource;
   guint mode_flags;
 
-  resource = wl_resource_create (client, &wl_output_interface,
-                                MIN (META_WL_OUTPUT_VERSION, version), id);
+  resource = wl_resource_create (client, &wl_output_interface, version, id);
   wayland_output->resources = g_list_prepend (wayland_output->resources, resource);
 
   wl_resource_set_user_data (resource, wayland_output);
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index 86ced3e..54b74dc 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -84,8 +84,7 @@ bind_seat (struct wl_client *client,
   MetaWaylandSeat *seat = data;
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &wl_seat_interface,
-                                MIN (META_WL_SEAT_VERSION, version), id);
+  resource = wl_resource_create (client, &wl_seat_interface, version, id);
   wl_resource_set_implementation (resource, &seat_interface, seat, unbind_resource);
   wl_list_insert (&seat->base_resource_list, wl_resource_get_link (resource));
 
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 45e585d..30d7569 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1133,7 +1133,7 @@ bind_xdg_shell (struct wl_client *client,
 
   xdg_shell = g_slice_new (XdgShell);
 
-  xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, META_XDG_SHELL_VERSION, id);
+  xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, version, id);
   wl_resource_set_implementation (xdg_shell->resource, &meta_wayland_xdg_shell_interface, data, NULL);
 
   xdg_shell->client_destroy_listener.notify = xdg_shell_handle_client_destroy;
@@ -1385,8 +1385,7 @@ bind_wl_shell (struct wl_client *client,
 {
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &wl_shell_interface,
-                                 MIN (META_WL_SHELL_VERSION, version), id);
+  resource = wl_resource_create (client, &wl_shell_interface, version, id);
   wl_resource_set_implementation (resource, &meta_wayland_wl_shell_interface, data, NULL);
 }
 
@@ -1463,8 +1462,7 @@ bind_gtk_shell (struct wl_client *client,
 {
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &gtk_shell_interface,
-                                 MIN (META_GTK_SHELL_VERSION, version), id);
+  resource = wl_resource_create (client, &gtk_shell_interface, version, id);
   wl_resource_set_implementation (resource, &meta_wayland_gtk_shell_interface, data, NULL);
 
   /* FIXME: ask the plugin */
@@ -1749,8 +1747,7 @@ bind_subcompositor (struct wl_client *client,
 {
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &wl_subcompositor_interface,
-                                 MIN (META_WL_SUBCOMPOSITOR_VERSION, version), id);
+  resource = wl_resource_create (client, &wl_subcompositor_interface, version, id);
   wl_resource_set_implementation (resource, &meta_wayland_subcompositor_interface, data, NULL);
 }
 
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 62a7be6..a459b39 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -296,8 +296,7 @@ compositor_bind (struct wl_client *client,
   MetaWaylandCompositor *compositor = data;
   struct wl_resource *resource;
 
-  resource = wl_resource_create (client, &wl_compositor_interface,
-                                MIN (META_WL_COMPOSITOR_VERSION, version), id);
+  resource = wl_resource_create (client, &wl_compositor_interface, version, id);
   wl_resource_set_implementation (resource, &meta_wayland_compositor_interface, compositor, NULL);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]