[server] Implement the generic window property in QtSurfaceExtension

Summary:
Qt supports setting generic data on a QWindow. This change implements
the callback properly and forwards the property to the surface extension
instance. This allows the compositor to e.g. listen to
DynamicPropertyChangeEvents and get access to all additional set
properties.

Reviewers: #plasma_on_wayland

Subscribers: plasma-devel

Tags: #plasma_on_wayland

Differential Revision: https://phabricator.kde.org/D3045
This commit is contained in:
Martin Gräßlin 2016-10-13 09:27:27 +02:00
parent 336ff134da
commit bd34a6d828

View file

@ -181,9 +181,12 @@ void QtExtendedSurfaceInterface::Private::setWindowFlagsCallback(wl_client *clie
void QtExtendedSurfaceInterface::Private::updateGenericPropertyCallback(wl_client *client, wl_resource *resource, const char *name, wl_array *value)
{
Q_UNUSED(client)
Q_UNUSED(resource)
Q_UNUSED(name)
Q_UNUSED(value)
QByteArray data = QByteArray::fromRawData(static_cast<char *>(value->data), value->size);
QVariant variantValue;
QDataStream ds(data);
ds >> variantValue;
cast<Private>(resource)->q_func()->setProperty(name, variantValue);
}
QtExtendedSurfaceInterface::QtExtendedSurfaceInterface(QtSurfaceExtensionInterface *shell, SurfaceInterface *parent, wl_resource *parentResource)