From a0af748fc5767cdf1d73a9d777f485ceb141c33a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Fri, 2 Oct 2020 18:52:52 +0400 Subject: [PATCH] Update SNI state even if tray is deactivated --- .../platform/linux/main_window_linux.cpp | 14 +++++++------- .../SourceFiles/platform/linux/specific_linux.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 32a587f606..593d4b6531 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -568,6 +568,13 @@ void MainWindow::handleSNIOwnerChanged( const QString &service, const QString &oldOwner, const QString &newOwner) { + SNIAvailable = !newOwner.isEmpty(); + + const auto trayAvailable = SNIAvailable + || QSystemTrayIcon::isSystemTrayAvailable(); + + Platform::SetTrayIconSupported(trayAvailable); + if (Global::WorkMode().value() == dbiwmWindowOnly) { return; } @@ -586,13 +593,6 @@ void MainWindow::handleSNIOwnerChanged( } trayIcon = nullptr; - SNIAvailable = !newOwner.isEmpty(); - - const auto trayAvailable = SNIAvailable - || QSystemTrayIcon::isSystemTrayAvailable(); - - Platform::SetTrayIconSupported(trayAvailable); - if (trayAvailable) { psSetupTrayIcon(); } else { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 84e38b615e..33c5e04a52 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -85,7 +85,7 @@ constexpr auto kXCBFrameExtentsAtomName = "_GTK_FRAME_EXTENTS"_cs; QStringList PlatformThemes; -bool IsTrayIconSupported = true; +bool IsTrayIconSupported = false; #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION void PortalAutostart(bool autostart, bool silent = false) {