diff options
author | Marco Trevisan (TreviƱo) <mail@3v1n0.net> | 2017-01-13 17:40:56 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-01-19 18:44:27 +0000 |
commit | b934572b30ca64ea0f85dffaeb9ff3c30add1e7e (patch) | |
tree | d6b6514c4a39c9144604bb143960c266935b9cdc /src/platformsupport | |
parent | 3edeb5c909a4ec62440e2075b9d49ec256a1ba68 (diff) |
QDBusTrayIcon: always save the temp icon in Unity
We enforce the check of saving the icon when the indicator
process name isn't available (as we might be running in a
confined world), but we're running in Unity.
Change-Id: I80d3be1a8c6eba8c391364260746e78cf89a5b98
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/platformsupport')
-rw-r--r-- | src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp index 5c4157c206..b55ace357a 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp +++ b/src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp @@ -171,6 +171,12 @@ QTemporaryFile *QDBusTrayIcon::tempIcon(const QIcon &icon) uint pid = session.interface()->servicePid(KDEWatcherService).value(); QString processName = QLockFilePrivate::processNameByPid(pid); necessary = processName.endsWith(QLatin1String("indicator-application-service")); + if (!necessary && QGuiApplication::desktopSettingsAware()) { + // Accessing to process name might be not allowed if the application + // is confined, thus we can just rely on the current desktop in use + const QPlatformServices *services = QGuiApplicationPrivate::platformIntegration()->services(); + necessary = services->desktopEnvironment().split(':').contains("UNITY"); + } necessity_checked = true; } if (!necessary) |