From 4c1f83dacab08f2220406c79db8f31c354887984 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 14 May 2020 21:03:36 +0400 Subject: [PATCH] Add a check for bundled Qt plugins --- .../SourceFiles/platform/linux/specific_linux.cpp | 14 ++++++++++++-- .../SourceFiles/platform/linux/specific_linux.h | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 8fa0a35fa..718489156 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -271,6 +271,14 @@ bool IsGtkFileDialogForced() { #endif // !TDESKTOP_FORCE_GTK_FILE_DIALOG } +bool IsQtPluginsBundled() { +#ifdef DESKTOP_APP_USE_PACKAGED_LAZY + return true; +#else // DESKTOP_APP_USE_PACKAGED_LAZY + return false; +#endif // !DESKTOP_APP_USE_PACKAGED_LAZY +} + bool IsXDGDesktopPortalPresent() { #ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION static const auto XDGDesktopPortalPresent = false; @@ -633,14 +641,16 @@ void start() { if(IsStaticBinary() || InAppImage() || InSandbox() - || InSnap()) { + || InSnap() + || IsQtPluginsBundled()) { qputenv("QT_WAYLAND_DECORATION", "material"); } if(IsStaticBinary() || InAppImage() || InSnap() - || IsGtkFileDialogForced()) { + || IsGtkFileDialogForced() + || IsQtPluginsBundled()) { LOG(("Checking for XDG Desktop Portal...")); // this can give us a chance to use a proper file dialog for current session if (IsXDGDesktopPortalPresent()) { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.h b/Telegram/SourceFiles/platform/linux/specific_linux.h index f3a79555e..a0cff2971 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.h +++ b/Telegram/SourceFiles/platform/linux/specific_linux.h @@ -25,6 +25,7 @@ bool InSnap(); bool InAppImage(); bool IsStaticBinary(); bool IsGtkFileDialogForced(); +bool IsQtPluginsBundled(); bool IsXDGDesktopPortalPresent(); bool UseXDGDesktopPortal();