From 148888b569454621f19dbea609698a129994b383 Mon Sep 17 00:00:00 2001 From: Carson Black Date: Fri, 20 Mar 2020 14:40:56 -0400 Subject: [PATCH] Broadcast application menu to resources when registering them Summary: Previously, KWayland wasn't hanging onto the application menu to broadcast it when registering a resource. This fixes that. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kde-frameworks-devel, zzag Tags: #frameworks Differential Revision: https://phabricator.kde.org/D28168 --- src/wayland/plasmawindowmanagement_interface.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wayland/plasmawindowmanagement_interface.cpp b/src/wayland/plasmawindowmanagement_interface.cpp index 4e611a05d4..7a1bc28c86 100644 --- a/src/wayland/plasmawindowmanagement_interface.cpp +++ b/src/wayland/plasmawindowmanagement_interface.cpp @@ -105,6 +105,8 @@ private: QString m_appId; quint32 m_pid = 0; QString m_themedIconName; + QString m_appServiceName; + QString m_appObjectPath; QIcon m_icon; quint32 m_virtualDesktop = 0; quint32 m_state = 0; @@ -357,6 +359,9 @@ void PlasmaWindowInterface::Private::createResource(wl_resource *parent, uint32_ if (!m_title.isEmpty()) { org_kde_plasma_window_send_title_changed(resource, m_title.toUtf8().constData()); } + if (!m_appObjectPath.isEmpty() || !m_appServiceName.isEmpty()) { + org_kde_plasma_window_send_application_menu(resource, m_appServiceName.toUtf8().constData(), m_appObjectPath.toUtf8().constData()); + } org_kde_plasma_window_send_state_changed(resource, m_state); if (!m_themedIconName.isEmpty()) { org_kde_plasma_window_send_themed_icon_name_changed(resource, m_themedIconName.toUtf8().constData()); @@ -577,6 +582,11 @@ void PlasmaWindowInterface::Private::setGeometry(const QRect &geo) void PlasmaWindowInterface::Private::setApplicationMenuPaths(const QString &service, const QString &object) { + if (m_appServiceName == service && m_appObjectPath == object) { + return; + } + m_appServiceName = service; + m_appObjectPath = object; for (auto it = resources.constBegin(); it != resources.constEnd(); ++it) { auto resource = *it; if (wl_resource_get_version(resource) < ORG_KDE_PLASMA_WINDOW_APPLICATION_MENU_SINCE_VERSION) {