summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp')
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
index a686a33464..5c4157c206 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
@@ -116,6 +116,8 @@ void QDBusTrayIcon::init()
{
qCDebug(qLcTray) << "registering" << m_instanceId;
m_registered = dBusConnection()->registerTrayIcon(this);
+ QObject::connect(dBusConnection()->dbusWatcher(), &QDBusServiceWatcher::serviceRegistered,
+ this, &QDBusTrayIcon::watcherServiceRegistered);
}
void QDBusTrayIcon::cleanup()
@@ -130,6 +132,15 @@ void QDBusTrayIcon::cleanup()
m_registered = false;
}
+void QDBusTrayIcon::watcherServiceRegistered(const QString &serviceName)
+{
+ Q_UNUSED(serviceName);
+ // We have the icon registered, but the watcher has restarted or
+ // changed, so we need to tell it about our icon again
+ if (m_registered)
+ dBusConnection()->registerTrayIconWithWatcher(this);
+}
+
void QDBusTrayIcon::attentionTimerExpired()
{
m_messageTitle = QString();