Commit 7c9021eb authored by Konrad Materka's avatar Konrad Materka
Browse files

[SNI] Handle NewMenu signal

Qt uses NewMenu signal to notify when new context menu is set.
It is not part of the official standard but already used by Qt
(starting from Qt 5.11).

BUG: 383202
FIXED-IN: 5.22.0
parent 9397d3a2
......@@ -132,6 +132,7 @@ StatusNotifierItemSource::StatusNotifierItemSource(const QString &notifierItemId
connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewOverlayIcon, this, &StatusNotifierItemSource::refreshIcons);
connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewToolTip, this, &StatusNotifierItemSource::refreshToolTip);
connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewStatus, this, &StatusNotifierItemSource::syncStatus);
connect(m_statusNotifierItemInterface, &OrgKdeStatusNotifierItem::NewMenu, this, &StatusNotifierItemSource::refreshMenu);
refresh();
}
}
......@@ -179,6 +180,15 @@ void StatusNotifierItemSource::refreshToolTip()
refresh();
}
void StatusNotifierItemSource::refreshMenu()
{
if (m_menuImporter) {
m_menuImporter->deleteLater();
m_menuImporter = nullptr;
}
refresh();
}
void StatusNotifierItemSource::refresh()
{
if (!m_refreshTimer.isActive()) {
......
......@@ -56,6 +56,7 @@ private Q_SLOTS:
void refreshTitle();
void refreshIcons();
void refreshToolTip();
void refreshMenu();
void refresh();
void performRefresh();
void syncStatus(QString);
......
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