From 55b2b04e2ea67078731e932c045622b465e4854a Mon Sep 17 00:00:00 2001 From: John Preston Date: Sat, 16 Mar 2024 09:54:07 +0400 Subject: [PATCH] Reapply "Disable system proxy support on Linux" This reverts commit 202a4064a43578980a21d57288569210a506cac5. --- Telegram/SourceFiles/core/sandbox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 6feacdb5b..fb145f7f1 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -33,6 +33,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include #include +#include namespace Core { namespace { @@ -517,8 +518,10 @@ void Sandbox::refreshGlobalProxy() { || proxy.type == MTP::ProxyData::Type::Http) { QNetworkProxy::setApplicationProxy( MTP::ToNetworkProxy(MTP::ToDirectIpProxy(proxy))); - } else if (!Core::IsAppLaunched() - || Core::App().settings().proxy().isSystem()) { + } else if ((!Core::IsAppLaunched() + || Core::App().settings().proxy().isSystem()) + // this works stable only in sandboxed environment where it works through portal + && (!Platform::IsLinux() || KSandbox::isInside() || cDebugMode())) { QNetworkProxyFactory::setUseSystemConfiguration(true); } else { QNetworkProxy::setApplicationProxy(QNetworkProxy::NoProxy);