mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-05 09:05:14 +00:00
Fix restart before exec on macOS.
This commit is contained in:
@@ -78,6 +78,8 @@ QString _escapeFrom7bit(const QString &str) {
|
||||
|
||||
} // namespace
|
||||
|
||||
bool Sandbox::QuitOnStartRequested = false;
|
||||
|
||||
Sandbox::Sandbox(
|
||||
not_null<Core::Launcher*> launcher,
|
||||
int &argc,
|
||||
@@ -155,9 +157,22 @@ int Sandbox::start() {
|
||||
_localSocket.connectToServer(_localServerName);
|
||||
}
|
||||
|
||||
if (QuitOnStartRequested) {
|
||||
closeApplication();
|
||||
return 0;
|
||||
}
|
||||
_started = true;
|
||||
return exec();
|
||||
}
|
||||
|
||||
void Sandbox::QuitWhenStarted() {
|
||||
if (!QApplication::instance() || !Instance()._started) {
|
||||
QuitOnStartRequested = true;
|
||||
} else {
|
||||
quit();
|
||||
}
|
||||
}
|
||||
|
||||
void Sandbox::launchApplication() {
|
||||
InvokeQueued(this, [=] {
|
||||
if (App::quitting()) {
|
||||
|
Reference in New Issue
Block a user