Bug 1505164 - Express explicit wailand interface versions r=jhorak
☠☠ backed out by 55cda59a1539 ☠ ☠
authorMartin Stransky <stransky@redhat.com>
Thu, 15 Nov 2018 14:52:04 +0000
changeset 505872 06d83f08f7a00bc2186792c62115efd1e887130a
parent 505871 4f54c06663d5fbf546d0c7be5acf710060d28972
child 505873 cec3c30f287bdc9c1f86c4c296d99dfa13d1e195
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1505164
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1505164 - Express explicit wailand interface versions r=jhorak Differential Revision: https://phabricator.services.mozilla.com/D11757
widget/gtk/WindowSurfaceWayland.cpp
widget/gtk/mozcontainer.cpp
widget/gtk/nsClipboardWayland.cpp
widget/gtk/nsGtkKeyUtils.cpp
--- a/widget/gtk/WindowSurfaceWayland.cpp
+++ b/widget/gtk/WindowSurfaceWayland.cpp
@@ -237,17 +237,18 @@ WaylandDisplayLoop(wl_display* aDisplay)
 
 static void
 global_registry_handler(void *data, wl_registry *registry, uint32_t id,
                         const char *interface, uint32_t version)
 {
   if (strcmp(interface, "wl_shm") == 0) {
     auto interface = reinterpret_cast<nsWaylandDisplay *>(data);
     auto shm = static_cast<wl_shm*>(
-        wl_registry_bind(registry, id, &wl_shm_interface, 1));
+        wl_registry_bind(registry, id, &wl_shm_interface,
+                         WL_SHM_POOL_RESIZE_SINCE_VERSION));
     wl_proxy_set_queue((struct wl_proxy *)shm, interface->GetEventQueue());
     interface->SetShm(shm);
   }
 }
 
 static void
 global_registry_remover(void *data, wl_registry *registry, uint32_t id)
 {
--- a/widget/gtk/mozcontainer.cpp
+++ b/widget/gtk/mozcontainer.cpp
@@ -175,19 +175,19 @@ registry_handle_global (void *data,
                         uint32_t name,
                         const char *interface,
                         uint32_t version)
 {
     MozContainer *container = MOZ_CONTAINER(data);
     if(strcmp(interface, "wl_subcompositor") == 0) {
         container->subcompositor =
             static_cast<wl_subcompositor*>(wl_registry_bind(registry,
-                                           name,
-                                           &wl_subcompositor_interface,
-                                           1));
+                name,
+                &wl_subcompositor_interface,
+                WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION));
     }
 }
 
 static void
 registry_handle_global_remove (void *data,
                                struct wl_registry *registry,
                                uint32_t name)
 {
--- a/widget/gtk/nsClipboardWayland.cpp
+++ b/widget/gtk/nsClipboardWayland.cpp
@@ -707,36 +707,41 @@ nsRetrievalContextWayland::HasSelectionS
     return mPrimarySelectionDataDeviceManager != nullptr;
 }
 
 void
 nsRetrievalContextWayland::InitDataDeviceManager(wl_registry *registry,
                                                  uint32_t id,
                                                  uint32_t version)
 {
-    int data_device_manager_version = MIN (version, 3);
+    // The documentation is pretty mean according wl_data_device_manager versions.
+    // We should be fine with version 1 but Gtk+ uses this construction
+    // so let's follow them.
+    int data_device_manager_version = MIN(version, 3);
     mDataDeviceManager = (wl_data_device_manager *)wl_registry_bind(registry, id,
         &wl_data_device_manager_interface, data_device_manager_version);
 }
 
 void
 nsRetrievalContextWayland::InitPrimarySelectionDataDeviceManager(
   wl_registry *registry, uint32_t id)
 {
     mPrimarySelectionDataDeviceManager =
         (gtk_primary_selection_device_manager *)wl_registry_bind(registry, id,
-            &gtk_primary_selection_device_manager_interface, 1);
+            &gtk_primary_selection_device_manager_interface,
+            /* First version of gtk_primary_selection extension */ 1);
 }
 
 void
 nsRetrievalContextWayland::InitSeat(wl_registry *registry,
                                     uint32_t id, uint32_t version,
                                     void *data)
 {
-    mSeat = (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface, 1);
+    mSeat = (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface,
+                                       WL_SEAT_CAPABILITIES_SINCE_VERSION);
 }
 
 static void
 gdk_registry_handle_global(void               *data,
                            struct wl_registry *registry,
                            uint32_t            id,
                            const char         *interface,
                            uint32_t            version)
--- a/widget/gtk/nsGtkKeyUtils.cpp
+++ b/widget/gtk/nsGtkKeyUtils.cpp
@@ -607,17 +607,18 @@ static void
 gdk_registry_handle_global(void               *data,
                            struct wl_registry *registry,
                            uint32_t            id,
                            const char         *interface,
                            uint32_t            version)
 {
     if (strcmp(interface, "wl_seat") == 0) {
         wl_seat *seat =
-            (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface, 1);
+            (wl_seat*)wl_registry_bind(registry, id, &wl_seat_interface,
+                                       WL_SEAT_CAPABILITIES_SINCE_VERSION);
         wl_seat_add_listener(seat, &seat_listener, data);
     }
 }
 
 static void
 gdk_registry_handle_global_remove(void               *data,
                                  struct wl_registry *registry,
                                  uint32_t            id)