From b8a84dbd831fafd90fec5a7cacc6e8ffdd8fd91b Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 13 Dec 2021 15:55:33 +0800 Subject: [PATCH] Disable system tray icon menu when app is exiting --- src/gui/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 48ab76156..f86c1922f 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1218,10 +1218,13 @@ void MainWindow::closeEvent(QCloseEvent *e) } } + // Disable some UI to prevent user interactions #ifndef Q_OS_MACOS - // Hide tray icon if (m_systrayIcon) - m_systrayIcon->hide(); + { + m_systrayIcon->setToolTip(tr("qBittorrent is shutting down...")); + m_trayIconMenu->setEnabled(false); + } #endif // Accept exit