diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 24e3fe701..d11896344 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();