1
0
telegram-desktop/0002-fix-directory-open-via-portals.patch
Marcel Kuehlhorn eb0efa9555 Accepting request 798825 from home:tux93:branches:home:KAMiKAZOW:Test
- Update to 2.1.0
  * Access a catalog of over 20,000 stickers made by professional
    artists from the updated Sticker Panel by clicking the '+' icon.
  * Use sticker search to find the stickers you're looking for
    or scroll from the latest packs all the way to the classics.
  * Add explanations that appear after users respond to a quiz question.
  * See how much time you have left to answer a question from
    @QuizBot with the new countdown animation.
  * Send a single 🎯 emoji to see if you hit the bullseye.
- Disable libdee requirement after Python2 removal
- Upstream recommends using xdg-desktop-portal, so we might do the same
- Add 0002-fix-directory-open-via-portals.patch
  * Upstream fix for a bug when opening directories via portals

OBS-URL: https://build.opensuse.org/request/show/798825
OBS-URL: https://build.opensuse.org/package/show/server:messaging/telegram-desktop?expand=0&rev=134
2020-04-29 08:50:19 +00:00

52 lines
2.1 KiB
Diff

From 7bc86cc9af28ba3d04a5cb69f6f7c16bfe7f8719 Mon Sep 17 00:00:00 2001
From: Ilya Fedin <fedin-ilja2010@ya.ru>
Date: Tue, 21 Apr 2020 23:05:17 +0400
Subject: [PATCH] Fix directory opening with portal and use them by default
with KDE
---
.../SourceFiles/platform/linux/file_utilities_linux.cpp | 6 +++---
Telegram/SourceFiles/platform/linux/specific_linux.cpp | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp b/Telegram/SourceFiles/platform/linux/file_utilities_linux.cpp
index 47dd56a411..88f8a69a91 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 0bb3963420..c12e5a0780 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;