summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorIlya Fedin <fedin-ilja2010@ya.ru>2021-02-14 23:06:23 +0400
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-07 20:32:08 +0000
commitae71de40b802a6017a2a04e667929bcbd2a2805d (patch)
tree866360600a374c914d71cd8699a2b749a86d90c7 /src/gui
parent5a09a21b6011114473a547ef12a4e63c9206de15 (diff)
indicator-application hack: fallback to dbus service check
There is a hack to work with Canonical's indicator-application tray applet. Since it implements the SNI spec partially and doesn't work with IconPixmap, the icon is broken without the hack. Unfortunately, this tray implementation is still in active use by Ubuntu; it's shipped and enabled by default on at least: * Xubuntu * Ubuntu MATE * Ubuntu Budgie (and maybe even others) Unfortunately, the check doesn't work in confined environments providing broken tray icons for snapped & flatpak'ed apps. Fortunately, snap allows checking all registered services on the host. It also fixes the check on flatpak if permissions to talk with these names are given. Change-Id: Iee5d0bb610c3ff397babee89ef1ee788ac19f477 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 0baa26638d7d14b6609dab191c4ea0cc1d3ff50a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/platform/unix/dbustray/qdbustrayicon.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/platform/unix/dbustray/qdbustrayicon.cpp b/src/gui/platform/unix/dbustray/qdbustrayicon.cpp
index 1194e4ac66..892a99d726 100644
--- a/src/gui/platform/unix/dbustray/qdbustrayicon.cpp
+++ b/src/gui/platform/unix/dbustray/qdbustrayicon.cpp
@@ -208,6 +208,14 @@ 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) {
+ necessary = session.interface()->isServiceRegistered(
+ QStringLiteral("com.canonical.indicator.application"));
+ }
+ if (!necessary) {
+ necessary = session.interface()->isServiceRegistered(
+ QStringLiteral("org.ayatana.indicator.application"));
+ }
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