From 11aa3c030bbde41bb8cdd5ffb904739f306ecd34 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 15 Feb 2014 10:02:48 -0500 Subject: [PATCH] wayland-surface: Don't require we manually bump the version for xdg-shell It's in the protocol as an enum. --- src/wayland/meta-wayland-surface.c | 14 +++++++++----- src/wayland/meta-wayland-versions.h | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c index 67b9551af..39738af92 100644 --- a/src/wayland/meta-wayland-surface.c +++ b/src/wayland/meta-wayland-surface.c @@ -713,7 +713,7 @@ xdg_shell_use_unstable_version (struct wl_client *client, struct wl_resource *resource, int32_t version) { - if (version != META_XDG_SHELL_VERSION) + if (version != XDG_SHELL_VERSION_CURRENT) g_warning ("Bad xdg_shell version: %d", version); } @@ -1086,8 +1086,13 @@ bind_xdg_shell (struct wl_client *client, { struct wl_resource *resource; - resource = wl_resource_create (client, &xdg_shell_interface, - MIN (META_XDG_SHELL_VERSION, version), id); + if (version != 1) + { + g_warning ("using xdg-shell without stable version 1\n"); + return; + } + + resource = wl_resource_create (client, &xdg_shell_interface, 1, id); wl_resource_set_implementation (resource, &meta_wayland_xdg_shell_interface, data, NULL); } @@ -1466,8 +1471,7 @@ void meta_wayland_init_shell (MetaWaylandCompositor *compositor) { if (wl_global_create (compositor->wayland_display, - &xdg_shell_interface, - META_XDG_SHELL_VERSION, + &xdg_shell_interface, 1, 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 531cbd4b9..e2d608c86 100644 --- a/src/wayland/meta-wayland-versions.h +++ b/src/wayland/meta-wayland-versions.h @@ -41,7 +41,6 @@ #define META_WL_OUTPUT_VERSION 2 #define META_XSERVER_VERSION 1 #define META_GTK_SHELL_VERSION 1 -#define META_XDG_SHELL_VERSION 1 #define META_WL_SUBCOMPOSITOR_VERSION 1 /* Slave objects (version inherited from a master object) */