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.
This commit is contained in:
Ilya Fedin 2022-05-19 09:11:58 +04:00 committed by John Preston
parent 6a80b1b94c
commit acd18a57fb
1 changed files with 0 additions and 42 deletions

View File

@ -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());