From 0b4a255accc41ced09df4a1022e3be67005f7d85 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 14 Sep 2023 00:12:32 +0400 Subject: [PATCH] Use SNAP_INSTANCE_NAME in SingleInstanceLocalServerName That's what snapd's apparmor profiles use --- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 84a7f6e6a..a51308111 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -452,7 +452,10 @@ void SetApplicationIcon(const QIcon &icon) { QString SingleInstanceLocalServerName(const QString &hash) { #if defined Q_OS_LINUX && QT_VERSION >= QT_VERSION_CHECK(6, 2, 0) if (KSandbox::isSnap()) { - return u"snap.telegram-desktop."_q + hash; + return u"snap."_q + + qEnvironmentVariable("SNAP_INSTANCE_NAME") + + '.' + + hash; } return hash + '-' + cGUIDStr(); #else // Q_OS_LINUX && Qt >= 6.2.0