From acd18a57fbbd7f2dc0329a96709f2df56e3306f4 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 19 May 2022 09:11:58 +0400 Subject: [PATCH] Get rid of the IBUS_USE_PORTAL workaround It's been a while after the ibus breaking change, the new socket path should be in all major distros and this hack shouldn't be needed anymore. --- .../platform/linux/specific_linux.cpp | 42 ------------------- 1 file changed, 42 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 9658115878..b72a3d0e5e 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -64,8 +64,6 @@ namespace { constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs; constexpr auto kIconName = "telegram"_cs; -constexpr auto kIBusPortalService = "org.freedesktop.portal.IBus"_cs; - #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION void PortalAutostart(bool start, bool silent) { if (cExeName().isEmpty()) { @@ -182,30 +180,6 @@ void PortalAutostart(bool start, bool silent) { } } } - -bool IsIBusPortalPresent() { - static const auto Result = [&] { - try { - const auto connection = Gio::DBus::Connection::get_sync( - Gio::DBus::BusType::BUS_TYPE_SESSION); - - const auto serviceRegistered = base::Platform::DBus::NameHasOwner( - connection, - std::string(kIBusPortalService)); - - const auto serviceActivatable = ranges::contains( - base::Platform::DBus::ListActivatableNames(connection), - Glib::ustring(std::string(kIBusPortalService))); - - return serviceRegistered || serviceActivatable; - } catch (...) { - } - - return false; - }(); - - return Result; -} #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION QByteArray EscapeShell(const QByteArray &content) { @@ -523,9 +497,6 @@ int psFixPrevious() { namespace Platform { void start() { - // Prevent any later calls into setlocale() by Qt - QCoreApplicationPrivate::initLocale(); - LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName())); #ifndef DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION @@ -553,19 +524,6 @@ void start() { "Application was built without embedded fonts, " "this may lead to font issues."); #endif // DESKTOP_APP_USE_PACKAGED_FONTS - - // IBus has changed its socket path several times - // and each change should be synchronized with Qt. - // Moreover, the last time Qt changed the path, - // they didn't introduce a fallback to the old path - // and made the new Qt incompatible with IBus from older distributions. - // 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 (IsIBusPortalPresent()) { - LOG(("IBus portal is present! Using it.")); - qputenv("IBUS_USE_PORTAL", "1"); - } #endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION const auto d = QFile::encodeName(QDir(cWorkingDir()).absolutePath());