summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-03-05 18:09:35 +0800
committerJonas Ådahl <jadahl@gmail.com>2015-04-23 16:02:37 +0800
commitdf3b412a254f606a79807e56961b6781fa171c9b (patch)
tree22160545d934628f9abca98f5ca56b117498ba1d
parentcfba0a5dfcbc2c921c171ac370e699aa44ffb376 (diff)
wayland: Kill clients who try to bind an incompatible gtk_shell version
gtk_shell is not backward compatible, and clients binding to it should check whether the advertised version is the same as the client supports. https://bugzilla.gnome.org/show_bug.cgi?id=745720
-rw-r--r--src/wayland/meta-wayland-surface.c11
-rw-r--r--src/wayland/protocol/gtk-shell.xml8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 16173bf6..a189e2fb 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1619,6 +1619,17 @@ bind_gtk_shell (struct wl_client *client,
uint32_t capabilities = 0;
resource = wl_resource_create (client, &gtk_shell_interface, version, id);
+
+ if (version != META_GTK_SHELL_VERSION)
+ {
+ wl_resource_post_error (resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "Incompatible gtk-shell version "
+ "(supported version: %d)",
+ META_GTK_SHELL_VERSION);
+ return;
+ }
+
wl_resource_set_implementation (resource, &meta_wayland_gtk_shell_interface, data, NULL);
if (!meta_prefs_get_show_fallback_app_menu ())
diff --git a/src/wayland/protocol/gtk-shell.xml b/src/wayland/protocol/gtk-shell.xml
index a8a83eba..bed61d6b 100644
--- a/src/wayland/protocol/gtk-shell.xml
+++ b/src/wayland/protocol/gtk-shell.xml
@@ -1,6 +1,14 @@
<protocol name="gtk">
<interface name="gtk_shell" version="1">
+ <description summary="gtk specific extensions">
+ gtk_shell is a protocol extension providing additional features for
+ clients implementing it. It is not backward compatible, and a client must
+ always only bind to the specific version it implements. If a client binds
+ to a version different from the version the server provides, an error will
+ be raised.
+ </description>
+
<enum name="capability">
<entry name="global_app_menu" value="1"/>
<entry name="global_menu_bar" value="2"/>