wayland: Only bind to supported gtk-shell versions

The gtk-shell Wayland protocol extension is not meant to be backward
compatible right now, so avoid binding to any version that is not the
one supported.

https://bugzilla.gnome.org/show_bug.cgi?id=745721
This commit is contained in:
Jonas Ådahl
2015-03-06 10:51:47 +08:00
parent a52ff2f66e
commit b4344861a0
2 changed files with 18 additions and 4 deletions

View File

@ -69,6 +69,8 @@
* ]|
*/
#define SUPPORTED_GTK_SHELL_VERSION 1
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *wayland_display);
G_DEFINE_TYPE (GdkWaylandDisplay, gdk_wayland_display, GDK_TYPE_DISPLAY)
@ -180,9 +182,13 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "gtk_shell") == 0)
{
display_wayland->gtk_shell =
wl_registry_bind (display_wayland->wl_registry, id, &gtk_shell_interface, 1);
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
if (version == SUPPORTED_GTK_SHELL_VERSION)
{
display_wayland->gtk_shell =
wl_registry_bind(display_wayland->wl_registry, id,
&gtk_shell_interface, SUPPORTED_GTK_SHELL_VERSION);
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
}
}
else if (strcmp (interface, "wl_output") == 0)
{