diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp index 47dd56a41..88f8a69a9 100644 --- a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp @@ -83,11 +83,11 @@ constexpr auto kPreviewHeight = 512; using Type = ::FileDialog::internal::Type; #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION -bool NativeSupported() { +bool NativeSupported(Type type = Type::ReadFile) { #ifndef TDESKTOP_FORCE_GTK_FILE_DIALOG return false; #endif // TDESKTOP_FORCE_GTK_FILE_DIALOG - return !Platform::UseXDGDesktopPortal() + return (!Platform::UseXDGDesktopPortal() || type == Type::ReadFolder) && Platform::internal::GdkHelperLoaded() && (Libs::gtk_widget_hide_on_delete != nullptr) && (Libs::gtk_clipboard_store != nullptr) @@ -192,7 +192,7 @@ bool Get( parent = parent->window(); } #ifndef TDESKTOP_DISABLE_GTK_INTEGRATION - if (NativeSupported()) { + if (NativeSupported(type)) { return GetNative( parent, files, diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 0bb396342..c12e5a078 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -266,7 +266,7 @@ bool UseXDGDesktopPortal() { const auto envVar = qEnvironmentVariableIsSet("TDESKTOP_USE_PORTAL"); const auto portalPresent = IsXDGDesktopPortalPresent(); - return envVar && portalPresent; + return (DesktopEnvironment::IsKDE() || envVar) && portalPresent; }(); return UsePortal;