From 2743aee6148b7da92f70fd404c563e9717e9ea40 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 20 Jun 2020 21:47:02 +0400 Subject: [PATCH] Disable restart on session start explicitly --- Telegram/SourceFiles/core/sandbox.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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();