summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/themes/genericunix
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2017-12-15 15:47:50 -0500
committerShawn Rutledge <shawn.rutledge@qt.io>2018-02-22 21:05:43 +0000
commitff169e8859457188f94aed86368876ba5bab2e90 (patch)
tree6179a7fefca742aa9c1130f1320075cfbbce0adb /src/platformsupport/themes/genericunix
parent2dc578a8f25b84abeae7a5049d93fb20d98607af (diff)
dbustray: add NewMenu signal and emit it when menu changed
This is a signal that is not actually supported by the StatusNotificationIcon standard, but it comes to be important for the Qt implementation of it, in fact qt apps might not have a menu, when exporting the Menu path as /NO_DBUSMENU or they could add this later in the execution. So, currently there's no way for the StatusNotificationWatcher to know when a menu has been added (or changed). Adding a NewMenu signal won't cause any troubles, but will allow watchers to be notified properly on menu addition. Change-Id: I9a8b00213f5023950811af1d62cd91bc51744b78 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/platformsupport/themes/genericunix')
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp2
-rw-r--r--src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
index 8480c15fb7..2153924ec8 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
+++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp
@@ -126,6 +126,7 @@ QDBusTrayIcon::QDBusTrayIcon()
connect(this, SIGNAL(tooltipChanged()), m_adaptor, SIGNAL(NewToolTip()));
connect(this, SIGNAL(iconChanged()), m_adaptor, SIGNAL(NewIcon()));
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewAttentionIcon()));
+ connect(this, SIGNAL(menuChanged()), m_adaptor, SIGNAL(NewMenu()));
connect(this, SIGNAL(attention()), m_adaptor, SIGNAL(NewTitle()));
connect(&m_attentionTimer, SIGNAL(timeout()), this, SLOT(attentionTimerExpired()));
m_attentionTimer.setSingleShot(true);
@@ -268,6 +269,7 @@ void QDBusTrayIcon::updateMenu(QPlatformMenu * menu)
connect(m_menu, SIGNAL(updated(uint,int)),
m_menuAdaptor, SIGNAL(LayoutUpdated(uint,int)));
dBusConnection()->registerTrayIconMenu(this);
+ emit menuChanged();
}
}
diff --git a/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h b/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h
index 3f8fca7ac0..f2bb156b1d 100644
--- a/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h
+++ b/src/platformsupport/themes/genericunix/dbustray/qstatusnotifieritemadaptor_p.h
@@ -129,6 +129,7 @@ class QStatusNotifierItemAdaptor: public QDBusAbstractAdaptor
" <signal name=\"NewIcon\"/>\n"
" <signal name=\"NewAttentionIcon\"/>\n"
" <signal name=\"NewOverlayIcon\"/>\n"
+" <signal name=\"NewMenu\"/>\n"
" <signal name=\"NewToolTip\"/>\n"
" <signal name=\"NewStatus\">\n"
" <arg type=\"s\" name=\"status\"/>\n"
@@ -191,6 +192,7 @@ Q_SIGNALS: // SIGNALS
void NewAttentionIcon();
void NewIcon();
void NewOverlayIcon();
+ void NewMenu();
void NewStatus(const QString &status);
void NewTitle();
void NewToolTip();