diff options
author | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-02-10 02:18:30 +0400 |
---|---|---|
committer | Ilya Fedin <fedin-ilja2010@ya.ru> | 2022-02-12 03:01:08 +0400 |
commit | bc3723d4620718dfe8bd0165e9ef8ba45a3da262 (patch) | |
tree | 58b44858683544d0f5d58544a37ee9dc61d84f7c /src/gui/platform | |
parent | 46e9852a1d04357c98b2c62338e1e2af0de9b486 (diff) |
Make indicator-application hack work in flatpak
Flatpak doesn't share $XDG_RUNTIME_DIR with the host making
QSystemTrayIcon not to work on Xubuntu/Ubuntu MATE/Ubuntu Budgie.
Although, it shares a subfolder, according to
https://docs.flatpak.org/en/latest/sandbox-permissions.html
Amends 0baa26638d7d14b6609dab191c4ea0cc1d3ff50a
Pick-to: 6.3 6.2 5.15
Change-Id: I2d0043fc5a4c2c51e8fa1a920f3cada3b07eba6d
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Diffstat (limited to 'src/gui/platform')
-rw-r--r-- | src/gui/platform/unix/dbustray/qdbustrayicon.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/platform/unix/dbustray/qdbustrayicon.cpp b/src/gui/platform/unix/dbustray/qdbustrayicon.cpp index 892a99d726..57c1b65cde 100644 --- a/src/gui/platform/unix/dbustray/qdbustrayicon.cpp +++ b/src/gui/platform/unix/dbustray/qdbustrayicon.cpp @@ -46,6 +46,7 @@ #include <QRect> #include <QLoggingCategory> #include <QStandardPaths> +#include <QFileInfo> #include <QDir> #include <QMetaObject> #include <QMetaEnum> @@ -76,8 +77,12 @@ Q_LOGGING_CATEGORY(qLcTray, "qt.qpa.tray") static QString iconTempPath() { QString tempPath = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); - if (!tempPath.isEmpty()) + if (!tempPath.isEmpty()) { + QString flatpakId = qEnvironmentVariable("FLATPAK_ID"); + if (!flatpakId.isEmpty() && QFileInfo::exists(QLatin1String("/.flatpak-info"))) + tempPath += QLatin1String("/app/") + flatpakId; return tempPath; + } tempPath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); |