diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 6ee7325145..10ec299035 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -50,13 +50,27 @@ bool GetServiceRegistered() { const auto connection = Gio::DBus::Connection::get_sync( Gio::DBus::BusType::BUS_TYPE_SESSION); - static const auto activatable = ranges::contains( - base::Platform::DBus::ListActivatableNames(connection), - Glib::ustring(std::string(kService))); + const auto hasOwner = [&] { + try { + return base::Platform::DBus::NameHasOwner( + connection, + std::string(kService)); + } catch (...) { + return false; + } + }(); - return base::Platform::DBus::NameHasOwner( - connection, - std::string(kService)) || activatable; + static const auto activatable = [&] { + try { + return ranges::contains( + base::Platform::DBus::ListActivatableNames(connection), + Glib::ustring(std::string(kService))); + } catch (...) { + return false; + } + }(); + + return hasOwner || activatable; } catch (...) { } diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 8f9c0461c7..fc35d07c6f 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -371,14 +371,6 @@ bool InSnap() { return Result; } -bool AreQtPluginsBundled() { -#if !defined DESKTOP_APP_USE_PACKAGED || defined DESKTOP_APP_USE_PACKAGED_LAZY - return true; -#else // !DESKTOP_APP_USE_PACKAGED || DESKTOP_APP_USE_PACKAGED_LAZY - return false; -#endif // DESKTOP_APP_USE_PACKAGED && !DESKTOP_APP_USE_PACKAGED_LAZY -} - QString AppRuntimeDirectory() { static const auto Result = [&] { auto runtimeDir = QStandardPaths::writableLocation( @@ -659,10 +651,7 @@ void start() { // Since tdesktop is distributed in static binary form, // it makes sense to use ibus portal whenever it present // to ensure compatibility with the maximum range of distributions. - if (AreQtPluginsBundled() - && !InFlatpak() - && !InSnap() - && IsIBusPortalPresent()) { + if (IsIBusPortalPresent()) { LOG(("IBus portal is present! Using it.")); qputenv("IBUS_USE_PORTAL", "1"); } diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.h b/Telegram/SourceFiles/platform/linux/specific_linux.h index 0f84f09192..21cc925379 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.h +++ b/Telegram/SourceFiles/platform/linux/specific_linux.h @@ -17,7 +17,6 @@ namespace Platform { bool InFlatpak(); bool InSnap(); -bool AreQtPluginsBundled(); QString AppRuntimeDirectory(); QString GetLauncherBasename();