Don't remove SNI object when SNI is lost
This commit is contained in:
parent
e71b7dd384
commit
a1a7399023
|
@ -451,7 +451,7 @@ void MainWindow::initHook() {
|
||||||
|
|
||||||
bool MainWindow::hasTrayIcon() const {
|
bool MainWindow::hasTrayIcon() const {
|
||||||
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#ifndef TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
return trayIcon || _sniTrayIcon;
|
return trayIcon || (SNIAvailable && _sniTrayIcon);
|
||||||
#else
|
#else
|
||||||
return trayIcon;
|
return trayIcon;
|
||||||
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
#endif // !TDESKTOP_DISABLE_DBUS_INTEGRATION
|
||||||
|
@ -545,12 +545,6 @@ void MainWindow::onSNIOwnerChanged(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sniTrayIcon) {
|
|
||||||
_sniTrayIcon->setContextMenu(0);
|
|
||||||
_sniTrayIcon->deleteLater();
|
|
||||||
}
|
|
||||||
_sniTrayIcon = nullptr;
|
|
||||||
|
|
||||||
if (trayIcon) {
|
if (trayIcon) {
|
||||||
trayIcon->setContextMenu(0);
|
trayIcon->setContextMenu(0);
|
||||||
trayIcon->deleteLater();
|
trayIcon->deleteLater();
|
||||||
|
|
Loading…
Reference in New Issue