diff options
author | Jan Grulich <jgrulich@redhat.com> | 2018-08-30 10:45:49 +0200 |
---|---|---|
committer | Jan Grulich <jgrulich@redhat.com> | 2018-09-02 14:15:38 +0000 |
commit | 101cb8e5d97f2f26ff0b3efd7b6e8b0e336e62be (patch) | |
tree | a3038489aa471e41bc1d118d537fa91ae984a8c9 /src/gui/kernel/qguiapplication.cpp | |
parent | 7c0884f2a2b02ed91ee49f79ef2fff27c2567c39 (diff) |
Make flatpak portal support to be used also by Snap applications
Snap now uses xdg-desktop-portal for portal support. Add check for apps
running in Snap and make them use portals by default. We also should be
using different name for the platform theme used by sandboxed apps.
Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index bc1f83a9c8..9bf2a33e2a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -256,10 +256,10 @@ static inline void clearFontUnlocked() QGuiApplicationPrivate::app_font = 0; } -static bool checkRunningUnderFlatpak() +static bool checkNeedPortalSupport() { #if QT_CONFIG(dbus) - return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty(); + return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); #else return false; #endif // QT_CONFIG(dbus) @@ -1225,9 +1225,9 @@ static void init_platform(const QString &pluginNamesWithArguments, const QString if (!platformThemeName.isEmpty()) themeNames.append(platformThemeName); - // 2) Special case - check whether we are in sandbox to use flatpak platform theme for portals support - if (checkRunningUnderFlatpak()) { - themeNames.append(QStringLiteral("flatpak")); + // 2) Special case - check whether it's a flatpak or snap app to use xdg-desktop-portal platform theme for portals support + if (checkNeedPortalSupport()) { + themeNames.append(QStringLiteral("xdgdesktopportal")); } // 3) Ask the platform integration for a list of theme names |