diff --git a/src/wayland/plasmawindowmanagement_interface.cpp b/src/wayland/plasmawindowmanagement_interface.cpp index 6587951cb8..d97370f156 100644 --- a/src/wayland/plasmawindowmanagement_interface.cpp +++ b/src/wayland/plasmawindowmanagement_interface.cpp @@ -67,6 +67,7 @@ public: void setParentWindow(PlasmaWindowInterface *parent); void setGeometry(const QRect &geometry); void setApplicationMenuPaths(const QString &service, const QString &object); + void setResourceName(const QString &resourceName); wl_resource *resourceForParent(PlasmaWindowInterface *parent, Resource *child) const; quint32 windowId = 0; @@ -89,6 +90,7 @@ public: QIcon m_icon; quint32 m_state = 0; QString uuid; + QString m_resourceName; protected: void org_kde_plasma_window_bind_resource(Resource *resource) override; @@ -375,6 +377,11 @@ void PlasmaWindowInterfacePrivate::org_kde_plasma_window_bind_resource(Resource if (resource->version() >= ORG_KDE_PLASMA_WINDOW_INITIAL_STATE_SINCE_VERSION) { send_initial_state(resource->handle); } + if (!m_resourceName.isEmpty()) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_RESOURCE_NAME_CHANGED_SINCE_VERSION) { + send_resource_name_changed(resource->handle, m_resourceName); + } + } } void PlasmaWindowInterfacePrivate::setAppId(const QString &appId) @@ -430,6 +437,21 @@ void PlasmaWindowInterfacePrivate::setIcon(const QIcon &icon) } } +void PlasmaWindowInterfacePrivate::setResourceName(const QString &resourceName) +{ + if (m_resourceName == resourceName) { + return; + } + m_resourceName = resourceName; + + const auto clientResources = resourceMap(); + for (auto resource : clientResources) { + if (resource->version() >= ORG_KDE_PLASMA_WINDOW_RESOURCE_NAME_CHANGED_SINCE_VERSION) { + send_resource_name_changed(resource->handle, resourceName); + } + } +} + void PlasmaWindowInterfacePrivate::org_kde_plasma_window_get_icon(Resource *resource, int32_t fd) { Q_UNUSED(resource) @@ -867,6 +889,11 @@ void PlasmaWindowInterface::setIcon(const QIcon &icon) d->setIcon(icon); } +void PlasmaWindowInterface::setResourceName(const QString &resourceName) +{ + d->setResourceName(resourceName); +} + void PlasmaWindowInterface::addPlasmaVirtualDesktop(const QString &id) { // don't add a desktop we're not sure it exists diff --git a/src/wayland/plasmawindowmanagement_interface.h b/src/wayland/plasmawindowmanagement_interface.h index d6fa19e3a3..722eeebaa2 100644 --- a/src/wayland/plasmawindowmanagement_interface.h +++ b/src/wayland/plasmawindowmanagement_interface.h @@ -129,6 +129,7 @@ public: void setShaded(bool set); void setMovable(bool set); void setResizable(bool set); + void setResourceName(const QString &resourceName); /** * FIXME: still relevant with new desktops? */