Commit 394b5082 authored by Carson Black's avatar Carson Black 🍿

[wayland] Broadcast application menu events

Summary:
Broadcasts application menu events to
clients listening to the PlasmaWindow interface.
Needs D27464.

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27818
parent 4ae6c99c
......@@ -1421,6 +1421,11 @@ void AbstractClient::setupWindowManagementInterface()
w->setGeometry(frameGeometry());
}
);
connect(this, &AbstractClient::applicationMenuChanged, w,
[w, this] {
w->setApplicationMenuPaths(applicationMenuServiceName(), applicationMenuObjectPath());
}
);
connect(w, &PlasmaWindowInterface::closeRequested, this, [this] { closeWindow(); });
connect(w, &PlasmaWindowInterface::moveRequested, this,
[this] {
......@@ -2465,6 +2470,7 @@ void AbstractClient::updateApplicationMenuServiceName(const QString &serviceName
const bool new_hasApplicationMenu = hasApplicationMenu();
emit applicationMenuChanged();
if (old_hasApplicationMenu != new_hasApplicationMenu) {
emit hasApplicationMenuChanged(new_hasApplicationMenu);
}
......@@ -2478,6 +2484,7 @@ void AbstractClient::updateApplicationMenuObjectPath(const QString &objectPath)
const bool new_hasApplicationMenu = hasApplicationMenu();
emit applicationMenuChanged();
if (old_hasApplicationMenu != new_hasApplicationMenu) {
emit hasApplicationMenuChanged(new_hasApplicationMenu);
}
......
......@@ -907,6 +907,7 @@ Q_SIGNALS:
void shadeableChanged(bool);
void maximizeableChanged(bool);
void desktopFileNameChanged();
void applicationMenuChanged();
void hasApplicationMenuChanged(bool);
void applicationMenuActiveChanged(bool);
void unresponsiveChanged(bool);
......
Markdown is supported
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