diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 7b2e5d9efe..24e3fe7018 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -291,6 +291,14 @@ std::unique_ptr TrayIconFile( return ret; } + +bool UseUnityCounter() { + static const auto UnityCounter = QDBusInterface( + "com.canonical.Unity", + "/").isValid(); + + return UnityCounter; +} #endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION bool IsSNIAvailable() { @@ -319,18 +327,6 @@ bool IsSNIAvailable() { return false; } -bool UseUnityCounter() { -#ifdef TDESKTOP_DISABLE_DBUS_INTEGRATION - static const auto UnityCounter = false; -#else // TDESKTOP_DISABLE_DBUS_INTEGRATION - static const auto UnityCounter = QDBusInterface( - "com.canonical.Unity", - "/").isValid(); -#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION - - return UnityCounter; -} - quint32 djbStringHash(QString string) { quint32 hash = 5381; QByteArray chars = string.toLatin1(); @@ -438,13 +434,19 @@ void MainWindow::initHook() { &QWindow::visibleChanged, this, &MainWindow::onVisibleChanged); -#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION + + if (AppMenuSupported()) { + LOG(("Using D-Bus global menu.")); + } else { + LOG(("Not using D-Bus global menu.")); + } if (UseUnityCounter()) { LOG(("Using Unity launcher counter.")); } else { LOG(("Not using Unity launcher counter.")); } +#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION } bool MainWindow::hasTrayIcon() const {