Disable restart on session start explicitly
This commit is contained in:
parent
06a4480520
commit
2743aee614
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "facades.h"
|
||||
#include "app.h"
|
||||
|
||||
#include <QtGui/QSessionManager>
|
||||
#include <QtGui/QScreen>
|
||||
|
||||
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();
|
||||
|
|
Loading…
Reference in New Issue