Commit 265504a0 authored by Martin Flöser's avatar Martin Flöser
Browse files

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
parent 38d155ff
......@@ -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;
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()) {
delete dataSource;
......@@ -110,7 +114,7 @@ void DataDeviceManagerInterface::Private::getDataDevice(wl_client *client, wl_re
SeatInterface *s = SeatInterface::get(seat);
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()) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment