From a1a7399023e9e86263a541478cbd3241cb1e729b Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 13 Apr 2020 06:06:31 +0400 Subject: [PATCH] Don't remove SNI object when SNI is lost --- Telegram/SourceFiles/platform/linux/main_window_linux.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 24e3fe7018..d11896344a 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -451,7 +451,7 @@ void MainWindow::initHook() { bool MainWindow::hasTrayIcon() const { #ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION - return trayIcon || _sniTrayIcon; + return trayIcon || (SNIAvailable && _sniTrayIcon); #else return trayIcon; #endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION @@ -545,12 +545,6 @@ void MainWindow::onSNIOwnerChanged( return; } - if (_sniTrayIcon) { - _sniTrayIcon->setContextMenu(0); - _sniTrayIcon->deleteLater(); - } - _sniTrayIcon = nullptr; - if (trayIcon) { trayIcon->setContextMenu(0); trayIcon->deleteLater();