mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Improved graceful shutdown, added "m_shutdownInProgress"
* no assert when wait is called in same thread, just ignore wait * quitAndWait readers, also works if not already noved in new thread (see above)
This commit is contained in:
@@ -34,10 +34,10 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QEventLoop>
|
||||
#include <QApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QIcon>
|
||||
#include <QKeySequence>
|
||||
@@ -86,6 +86,9 @@ namespace BlackGui
|
||||
this->addWindowModeOption();
|
||||
this->addWindowResetSizeOption();
|
||||
|
||||
// notify when app goes down
|
||||
connect(qGuiApp, &QGuiApplication::lastWindowClosed, this, &CGuiApplication::gracefulShutdown);
|
||||
|
||||
if (!sGui)
|
||||
{
|
||||
CGuiApplication::registerMetadata();
|
||||
@@ -879,11 +882,12 @@ namespace BlackGui
|
||||
|
||||
void CGuiApplication::gracefulShutdown()
|
||||
{
|
||||
if (m_shutdownInProgress) { return; }
|
||||
CApplication::gracefulShutdown();
|
||||
if (m_saveMainWidgetState)
|
||||
{
|
||||
this->saveWindowGeometryAndState();
|
||||
}
|
||||
CApplication::gracefulShutdown();
|
||||
}
|
||||
|
||||
void CGuiApplication::settingsChanged()
|
||||
|
||||
Reference in New Issue
Block a user