mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 22:27:20 +02:00
Use abstract socket for single instance on Linux
This commit is contained in:
parent
bebf8e4a03
commit
30f057fff5
2 changed files with 11 additions and 0 deletions
|
@ -122,6 +122,10 @@ int Sandbox::start() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
_localServer.setSocketOptions(QLocalServer::AbstractNamespaceOption);
|
||||
#endif
|
||||
|
||||
connect(
|
||||
&_localSocket,
|
||||
&QLocalSocket::connected,
|
||||
|
|
|
@ -557,7 +557,14 @@ void SetApplicationIcon(const QIcon &icon) {
|
|||
}
|
||||
|
||||
QString SingleInstanceLocalServerName(const QString &hash) {
|
||||
#ifdef Q_OS_LINUX
|
||||
if (KSandbox::isSnap()) {
|
||||
return u"snap.telegram-desktop."_q + hash;
|
||||
}
|
||||
return hash + '-' + cGUIDStr();
|
||||
#else // Q_OS_LINUX
|
||||
return QDir::tempPath() + '/' + hash + '-' + cGUIDStr();
|
||||
#endif // !Q_OS_LINUX
|
||||
}
|
||||
|
||||
std::optional<bool> IsDarkMode() {
|
||||
|
|
Loading…
Add table
Reference in a new issue