summary refs log tree commit diff
path: root/src/TrayIcon.cpp
diff options
context:
space:
mode:
authorShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-29 13:46:00 +0800
committerShootingStarDragons <ShootingStarDragons@protonmail.com>2023-01-29 13:46:00 +0800
commit919ec2a5e3ceb1f9b09c69301e491f4fe100968f (patch)
tree4dfff58e8ecf53dfe6b391a783cca5ac93cfdfc8 /src/TrayIcon.cpp
parentMerge pull request #1319 from Decodetalkers/menuhideonwayland (diff)
downloadnheko-919ec2a5e3ceb1f9b09c69301e491f4fe100968f.tar.xz
feat: clean all notifications if exit on linux
Diffstat (limited to 'src/TrayIcon.cpp')
-rw-r--r--src/TrayIcon.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/TrayIcon.cpp b/src/TrayIcon.cpp

index 1e33ac8d..76ccb8fc 100644 --- a/src/TrayIcon.cpp +++ b/src/TrayIcon.cpp
@@ -15,6 +15,9 @@ #include "TrayIcon.h" +#if defined(Q_OS_LINUX) +#include "ChatPage.h" +#endif #if defined(Q_OS_MAC) #include <QtMacExtras> #endif @@ -119,7 +122,12 @@ TrayIcon::TrayIcon(const QString &filename, QWindow *parent) quitAction_ = new QAction(tr("Quit"), this); connect(viewAction_, &QAction::triggered, parent, &QWindow::show); - connect(quitAction_, &QAction::triggered, this, QApplication::quit); + connect(quitAction_, &QAction::triggered, this, [=] { +#if defined(Q_OS_LINUX) + ChatPage::instance()->removeAllNotifications(); +#endif + QApplication::quit(); + }); menu->addAction(viewAction_); menu->addAction(quitAction_);