From 265504a08812bc5c354b00fdafd87674167d446f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 15 Sep 2015 08:44:42 +0200 Subject: [PATCH] Increase version requirements for wl_data_device_release * wl_data_device_manager -> version 2 * wl_data_device -> version 2 * Wayland -> version 1.7 Unfortunately the client side is not yet completely correct. We need to call wl_data_device_release only if we have a data device of version 2. But there is no easy way to test this. To change we will need to introduce a client side version tracking. BUG: 352663 --- src/wayland/datadevicemanager_interface.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wayland/datadevicemanager_interface.cpp b/src/wayland/datadevicemanager_interface.cpp index 899207b444..168f6af6fb 100644 --- a/src/wayland/datadevicemanager_interface.cpp +++ b/src/wayland/datadevicemanager_interface.cpp @@ -49,9 +49,13 @@ private: DataDeviceManagerInterface *q; static const struct wl_data_device_manager_interface s_interface; static const quint32 s_version; + static const qint32 s_dataDeviceVersion; + static const qint32 s_dataSourceVersion; }; -const quint32 DataDeviceManagerInterface::Private::s_version = 1; +const quint32 DataDeviceManagerInterface::Private::s_version = 2; +const qint32 DataDeviceManagerInterface::Private::s_dataDeviceVersion = 2; +const qint32 DataDeviceManagerInterface::Private::s_dataSourceVersion = 1; #ifndef DOXYGEN_SHOULD_SKIP_THIS const struct wl_data_device_manager_interface DataDeviceManagerInterface::Private::s_interface = { @@ -91,7 +95,7 @@ void DataDeviceManagerInterface::Private::createDataSourceCallback(wl_client *cl void DataDeviceManagerInterface::Private::createDataSource(wl_client *client, wl_resource *resource, uint32_t id) { DataSourceInterface *dataSource = new DataSourceInterface(q, resource); - dataSource->create(display->getConnection(client), wl_resource_get_version(resource), id); + dataSource->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataSourceVersion) , id); if (!dataSource->resource()) { wl_resource_post_no_memory(resource); delete dataSource; @@ -110,7 +114,7 @@ void DataDeviceManagerInterface::Private::getDataDevice(wl_client *client, wl_re SeatInterface *s = SeatInterface::get(seat); Q_ASSERT(s); DataDeviceInterface *dataDevice = new DataDeviceInterface(s, q, resource); - dataDevice->create(display->getConnection(client), wl_resource_get_version(resource), id); + dataDevice->create(display->getConnection(client), qMin(wl_resource_get_version(resource), s_dataDeviceVersion), id); if (!dataDevice->resource()) { wl_resource_post_no_memory(resource); return;