From 44c24f9fff46e45fa4304c92f8f3d008d3d3c9f6 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 2 Nov 2020 03:26:06 +0400 Subject: [PATCH] Fix TDESKTOP_USE_PORTAL on gtk environments --- .../SourceFiles/platform/linux/file_utilities_linux.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index 0531a5b45..253bf528c 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -113,14 +113,15 @@ bool UseNative(Type type = Type::ReadFile) { // or if QT_QPA_PLATFORMTHEME=(gtk2|gtk3) // or if portals are used and operation is to open folder // and portal doesn't support folder choosing - const auto neededForPortal = UseXDGDesktopPortal() - && type == Type::ReadFolder + const auto neededForPortal = (type == Type::ReadFolder) && !CanOpenDirectoryWithPortal(); const auto neededNonForced = DesktopEnvironment::IsGtkBased() - || neededForPortal; + || (UseXDGDesktopPortal() && neededForPortal); - const auto excludeNonForced = InFlatpak() || InSnap(); + const auto excludeNonForced = InFlatpak() + || InSnap() + || (UseXDGDesktopPortal() && !neededForPortal); return IsGtkIntegrationForced() || (neededNonForced && !excludeNonForced);