[mutter] wayland: Use a named #define for the xdg-shell version



commit c9a2a561f8997fcef8e88a519071ce0215b61a97
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Jul 17 17:37:29 2014 -0400

    wayland: Use a named #define for the xdg-shell version

 src/wayland/meta-wayland-surface.c  |    9 +++++----
 src/wayland/meta-wayland-versions.h |    1 +
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index a560a3b..868ee59 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1118,15 +1118,15 @@ bind_xdg_shell (struct wl_client *client,
 {
   XdgShell *xdg_shell;
 
-  if (version != 1)
+  if (version != META_XDG_SHELL_VERSION)
     {
-      g_warning ("using xdg-shell without stable version 1\n");
+      g_warning ("using xdg-shell without stable version %d\n", META_XDG_SHELL_VERSION);
       return;
     }
 
   xdg_shell = g_slice_new (XdgShell);
 
-  xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, 1, id);
+  xdg_shell->resource = wl_resource_create (client, &xdg_shell_interface, META_XDG_SHELL_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;
@@ -1752,7 +1752,8 @@ void
 meta_wayland_shell_init (MetaWaylandCompositor *compositor)
 {
   if (wl_global_create (compositor->wayland_display,
-                        &xdg_shell_interface, 1,
+                        &xdg_shell_interface,
+                        META_XDG_SHELL_VERSION,
                         compositor, bind_xdg_shell) == NULL)
     g_error ("Failed to register a global xdg-shell object");
 
diff --git a/src/wayland/meta-wayland-versions.h b/src/wayland/meta-wayland-versions.h
index 1dc9fbe..d1301af 100644
--- a/src/wayland/meta-wayland-versions.h
+++ b/src/wayland/meta-wayland-versions.h
@@ -37,6 +37,7 @@
 /* Global/master objects (version exported by wl_registry and negotiated through bind) */
 #define META_WL_COMPOSITOR_VERSION          3
 #define META_WL_DATA_DEVICE_MANAGER_VERSION 1
+#define META_XDG_SHELL_VERSION              1
 #define META_WL_SHELL_VERSION               1
 #define META_WL_SEAT_VERSION                3
 #define META_WL_OUTPUT_VERSION              2


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