[gtk+] wayland: Only bind supported unstable pointer gestures global



commit 32cd1a744700c365f70410ac4090b113b1921598
Author: Jonas Ådahl <jadahl gmail com>
Date:   Thu Aug 20 11:38:43 2015 +0800

    wayland: Only bind supported unstable pointer gestures global
    
    As the protocol is still considered unstable (meaning not backward
    compatible), we should, as stated in the protocol, only bind the version
    advertised is the version we implement.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753856

 gdk/wayland/gdkdisplay-wayland.c |    6 ++++--
 gdk/wayland/gdkdisplay-wayland.h |    2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 32a0583..d1c58de 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -358,10 +358,12 @@ gdk_registry_handle_global (void               *data,
       display_wayland->subcompositor =
         wl_registry_bind (display_wayland->wl_registry, id, &wl_subcompositor_interface, 1);
     }
-  else if (strcmp (interface, "_wl_pointer_gestures") == 0)
+  else if (strcmp (interface, "_wl_pointer_gestures") == 0 &&
+           version == GDK__WL_POINTER_GESTURES_VERSION)
     {
       display_wayland->pointer_gestures =
-        wl_registry_bind (display_wayland->wl_registry, id, &_wl_pointer_gestures_interface, 1);
+        wl_registry_bind (display_wayland->wl_registry,
+                          id, &_wl_pointer_gestures_interface, version);
     }
   else
     handled = FALSE;
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index b834fd7..4156bc6 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -45,6 +45,8 @@ G_BEGIN_DECLS
 #define GDK_WAYLAND_MAX_THEME_SCALE 2
 #define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
 
+#define GDK__WL_POINTER_GESTURES_VERSION 1
+
 typedef struct _GdkWaylandSelection GdkWaylandSelection;
 
 struct _GdkWaylandDisplay


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