diff --git a/.github/workflows/appimage-release.yml b/.github/workflows/appimage-release.yml index 79cfe2822..d44fd1739 100644 --- a/.github/workflows/appimage-release.yml +++ b/.github/workflows/appimage-release.yml @@ -503,7 +503,7 @@ jobs: AppDir/usr/share/applications/*.desktop \ -appimage \ -exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \ - -extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration + -extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration - name: Move artifact. if: env.ONLY_CACHE == 'false' diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index a075c9b1b..247bd48d3 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -509,7 +509,7 @@ jobs: AppDir/usr/share/applications/*.desktop \ -appimage \ -exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \ - -extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration + -extra-plugins=bearer,iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration - name: Get artifact name. if: env.ONLY_CACHE == 'false' diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 2cdb39479..c4319da1a 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -252,6 +252,14 @@ bool IsStaticBinary() { #endif // !DESKTOP_APP_USE_PACKAGED } +bool IsGtkFileDialogForced() { +#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG + return true; +#else // TDESKTOP_FORCE_GTK_FILE_DIALOG + return false; +#endif // !TDESKTOP_FORCE_GTK_FILE_DIALOG +} + bool IsXDGDesktopPortalPresent() { #ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION static const auto XDGDesktopPortalPresent = false; @@ -607,21 +615,21 @@ void start() { qputenv("PULSE_PROP_application.name", AppName.utf8()); qputenv("PULSE_PROP_application.icon_name", GetIconName().toLatin1()); -#ifdef TDESKTOP_FORCE_GTK_FILE_DIALOG - LOG(("Checking for XDG Desktop Portal...")); - // this can give us a chance to use a proper file dialog for current session - if (IsXDGDesktopPortalPresent()) { - LOG(("XDG Desktop Portal is present!")); - if (UseXDGDesktopPortal()) { - LOG(("Usage of XDG Desktop Portal is enabled.")); - qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal"); + if(IsStaticBinary() || InAppImage() || IsGtkFileDialogForced()) { + LOG(("Checking for XDG Desktop Portal...")); + // this can give us a chance to use a proper file dialog for current session + if (IsXDGDesktopPortalPresent()) { + LOG(("XDG Desktop Portal is present!")); + if (UseXDGDesktopPortal()) { + LOG(("Usage of XDG Desktop Portal is enabled.")); + qputenv("QT_QPA_PLATFORMTHEME", "xdgdesktopportal"); + } else { + LOG(("Usage of XDG Desktop Portal is disabled.")); + } } else { - LOG(("Usage of XDG Desktop Portal is disabled.")); + LOG(("XDG Desktop Portal is not present :(")); } - } else { - LOG(("XDG Desktop Portal is not present :(")); } -#endif // TDESKTOP_FORCE_GTK_FILE_DIALOG } void finish() { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.h b/Telegram/SourceFiles/platform/linux/specific_linux.h index 4924b0223..f3a79555e 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.h +++ b/Telegram/SourceFiles/platform/linux/specific_linux.h @@ -24,6 +24,7 @@ bool InSandbox(); bool InSnap(); bool InAppImage(); bool IsStaticBinary(); +bool IsGtkFileDialogForced(); bool IsXDGDesktopPortalPresent(); bool UseXDGDesktopPortal();