Commit 44ca4155 authored by Usarin Heininga's avatar Usarin Heininga Committed by Aleix Pol Gonzalez
Browse files

Expose missing client UUids in plasma windowManagementInterface

StackingOrder.
parent 132bcb34
Pipeline #54893 passed with stage
in 7 minutes and 41 seconds
......@@ -30,9 +30,11 @@ class PlasmaWindowManagementInterfacePrivate : public QtWaylandServer::org_kde_p
public:
PlasmaWindowManagementInterfacePrivate(PlasmaWindowManagementInterface *_q, Display *display);
void sendShowingDesktopState();
void sendStackingOrderChanged();
void sendShowingDesktopState(wl_resource *resource);
void sendStackingOrderChanged();
void sendStackingOrderChanged(wl_resource *resource);
void sendStackingOrderUuidsChanged();
void sendStackingOrderUuidsChanged(wl_resource *resource);
PlasmaWindowManagementInterface::ShowingDesktopState state = PlasmaWindowManagementInterface::ShowingDesktopState::Disabled;
QList<PlasmaWindowInterface*> windows;
......@@ -151,13 +153,31 @@ void PlasmaWindowManagementInterfacePrivate::sendStackingOrderChanged(wl_resourc
}
send_stacking_order_changed(r, QByteArray::fromRawData(reinterpret_cast<const char*>(stackingOrder.constData()), sizeof(uint32_t) * stackingOrder.size()));
}
void PlasmaWindowManagementInterfacePrivate::sendStackingOrderUuidsChanged()
{
const auto clientResources = resourceMap();
for (auto resource : clientResources) {
sendStackingOrderUuidsChanged(resource->handle);
}
}
void PlasmaWindowManagementInterfacePrivate::sendStackingOrderUuidsChanged(wl_resource *r)
{
if (wl_resource_get_version(r) < ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STACKING_ORDER_UUID_CHANGED_SINCE_VERSION) {
return;
}
QString uuids;
for (const auto &uuid : qAsConst(stackingOrderUuids)) {
uuids += uuid;
uuids += QStringLiteral(";");
uuids += QLatin1Char(';');
}
// Remove the trailing ';', on the receiving side this is interpreted as an empty uuid.
if (stackingOrderUuids.size() > 0) {
uuids.remove(uuids.length() - 1, 1);
}
send_stacking_order_uuid_changed(r, uuids);
}
......@@ -171,6 +191,7 @@ void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_bi
}
}
sendStackingOrderChanged(resource->handle);
sendStackingOrderUuidsChanged(resource->handle);
}
void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_show_desktop(Resource *resource, uint32_t state)
......@@ -265,7 +286,7 @@ QList<PlasmaWindowInterface*> PlasmaWindowManagementInterface::windows() const
return d->windows;
}
void PlasmaWindowManagementInterface::setStackingOrder(const QVector<quint32>& stackingOrder)
void PlasmaWindowManagementInterface::setStackingOrder(const QVector<quint32> &stackingOrder)
{
if (d->stackingOrder == stackingOrder) {
return;
......@@ -274,6 +295,15 @@ void PlasmaWindowManagementInterface::setStackingOrder(const QVector<quint32>& s
d->sendStackingOrderChanged();
}
void PlasmaWindowManagementInterface::setStackingOrderUuids(const QVector<QString> &stackingOrderUuids)
{
if (d->stackingOrderUuids == stackingOrderUuids) {
return;
}
d->stackingOrderUuids = stackingOrderUuids;
d->sendStackingOrderUuidsChanged();
}
void PlasmaWindowManagementInterface::setPlasmaVirtualDesktopManagementInterface(PlasmaVirtualDesktopManagementInterface *manager)
{
if (d->plasmaVirtualDesktopManagementInterface == manager) {
......@@ -930,4 +960,9 @@ quint32 PlasmaWindowInterface::internalId() const
return d->windowId;
}
QString PlasmaWindowInterface::uuid() const
{
return d->uuid;
}
}
......@@ -58,6 +58,8 @@ public:
*/
void setStackingOrder(const QVector<quint32> &stackingOrder);
void setStackingOrderUuids(const QVector<QString> &stackingOrderUuids);
Q_SIGNALS:
void requestChangeShowingDesktop(ShowingDesktopState requestedState);
......@@ -185,7 +187,7 @@ public:
/**
* @return a unique string that identifies this window
*/
QByteArray uuid() const;
QString uuid() const;
Q_SIGNALS:
void closeRequested();
......
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