From b934572b30ca64ea0f85dffaeb9ff3c30add1e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 13 Jan 2017 17:40:56 +0100 Subject: 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 Reviewed-by: Shawn Rutledge --- src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/platformsupport/themes/genericunix/dbustray/qdbustrayicon.cpp') 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) -- cgit v1.2.3