diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 8c31e79374..84ad8a6682 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "facades.h" #include "app.h" +#include #include namespace Core { @@ -132,6 +133,19 @@ int Sandbox::start() { }); }); + // https://github.com/telegramdesktop/tdesktop/issues/948 + // and https://github.com/telegramdesktop/tdesktop/issues/5022 + const auto restartHint = [](QSessionManager &manager) { + manager.setRestartHint(QSessionManager::RestartNever); + }; + + connect( + this, + &QGuiApplication::saveStateRequest, + this, + restartHint, + Qt::DirectConnection); + if (cManyInstance()) { LOG(("Many instance allowed, starting...")); singleInstanceChecked();