mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 23:53:58 +02:00
Disable restart on session start explicitly
This commit is contained in:
parent
06a4480520
commit
2743aee614
1 changed files with 14 additions and 0 deletions
|
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "facades.h"
|
#include "facades.h"
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
|
|
||||||
|
#include <QtGui/QSessionManager>
|
||||||
#include <QtGui/QScreen>
|
#include <QtGui/QScreen>
|
||||||
|
|
||||||
namespace Core {
|
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()) {
|
if (cManyInstance()) {
|
||||||
LOG(("Many instance allowed, starting..."));
|
LOG(("Many instance allowed, starting..."));
|
||||||
singleInstanceChecked();
|
singleInstanceChecked();
|
||||||
|
|
Loading…
Add table
Reference in a new issue