2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-07 01:55:12 +00:00

Use XDG Desktop Portal for file dialog

This commit is contained in:
Ilya Fedin
2020-01-29 21:41:42 +04:00
committed by John Preston
parent d80b3fda7d
commit 0477bda929
4 changed files with 31 additions and 4 deletions

View File

@@ -21,9 +21,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION
#include <private/qguiapplication_p.h>
#endif // TDESKTOP_DISABLE_GTK_INTEGRATION
QStringList qt_make_filter_list(const QString &filter);
#endif // !TDESKTOP_DISABLE_GTK_INTEGRATION
namespace Platform {
namespace File {
@@ -87,7 +87,8 @@ bool NativeSupported() {
#ifndef TDESKTOP_FORCE_GTK_FILE_DIALOG
return false;
#endif // TDESKTOP_FORCE_GTK_FILE_DIALOG
return Platform::internal::GdkHelperLoaded()
return !Platform::IsXDGDesktopPortalPresent()
&& Platform::internal::GdkHelperLoaded()
&& (Libs::gtk_widget_hide_on_delete != nullptr)
&& (Libs::gtk_clipboard_store != nullptr)
&& (Libs::gtk_clipboard_get != nullptr)