Compare commits

...

4 Commits

Author SHA1 Message Date
MrMirDan
8c5f5b2f23 some changes 2025-09-05 16:51:19 +03:00
MrMirDan
ce37146edf cleaning tray and change quit to exit for Linux 2025-09-05 16:33:38 +03:00
MrMirDan
fa3dd7d553 cleaning tray 2025-09-05 15:53:10 +03:00
MrMirDan
b9021d6581 try to fix app quit on Linux 2025-09-05 15:30:02 +03:00
3 changed files with 19 additions and 3 deletions

View File

@@ -60,9 +60,9 @@ AmneziaApplication::~AmneziaApplication()
m_vpnConnectionThread.quit();
if (!m_vpnConnectionThread.wait(5000)) {
if (!m_vpnConnectionThread.wait(4000)) {
m_vpnConnectionThread.terminate();
m_vpnConnectionThread.wait();
m_vpnConnectionThread.wait(1000);
}
if (m_engine) {

View File

@@ -136,6 +136,12 @@ void PageController::setTriggeredByConnectButton(bool trigger)
void PageController::closeApplication()
{
#if defined(Q_OS_LINUX)
for (auto w : qApp->topLevelWidgets()) {
w->close();
}
QTimer::singleShot(0, qApp, []() { qApp->exit(0); });
#endif
qApp->quit();
}

View File

@@ -42,7 +42,17 @@ SystemTrayNotificationHandler::SystemTrayNotificationHandler(QObject* parent) :
m_trayActionQuit = m_menu.addAction(QIcon(":/images/tray/cancel.png"),
tr("Quit") + " " + APPLICATION_NAME,
this,
[&](){ qApp->quit(); });
[&](){
#if defined(Q_OS_LINUX)
m_systemTrayIcon.hide();
m_systemTrayIcon.setContextMenu(nullptr);
for (auto w : qApp->topLevelWidgets()) {
w->close();
}
#endif
qApp->quit();
});
m_systemTrayIcon.setContextMenu(&m_menu);
setTrayState(Vpn::ConnectionState::Disconnected);