Merge pull request #1609 from uhle/fix-utils-systray-detection

Query Qt whether system tray is available if not (Unity flavored) GNOME
This commit is contained in:
CraigD
2020-06-08 11:32:45 +01:00
committed by GitHub
2 changed files with 7 additions and 2 deletions

View File

@@ -26,6 +26,8 @@
17. Fix enabling of play queue navigation actions 'next' and 'previous'.
18. Fix bus name of freedesktop.org's power management.
19. Additionally call Inhibit() from org.freedesktop.login1.Manager.
20. Query Qt whether system tray is available if current desktop environment is
not some kind of GNOME (incl. Unity flavored GNOME).
2.4.1
-----

View File

@@ -35,6 +35,7 @@
#include <QDesktopWidget>
#include <QEventLoop>
#include <QStandardPaths>
#include <QSystemTrayIcon>
#include <QSet>
#include <QUrl>
#ifndef _MSC_VER
@@ -982,9 +983,11 @@ bool Utils::useSystemTray()
#elif defined Q_OS_WIN
return true;
#elif QT_QTDBUS_FOUND
return Gnome==currentDe() ? QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher") : true;
return (Gnome==currentDe() || Unity==currentDe())
? QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher")
: QSystemTrayIcon::isSystemTrayAvailable();
#else
return Gnome!=currentDe();
return Gnome!=currentDe() && Unity!=currentDe() && QSystemTrayIcon::isSystemTrayAvailable();
#endif
}