File mozilla-nongnome-proxies.patch of Package seamonkey

From: Wolfgang Rosenauer
Subject: Do not use gconf for proxy settings if not running within Gnome

diff -ruN seamonkey/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp seamonkey.new/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp
--- seamonkey/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	2020-02-18 00:39:44.000000000 +0100
+++ seamonkey.new/mozilla/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp	2020-03-02 12:41:27.735383057 +0100
@@ -59,13 +59,17 @@
 nsresult
 nsUnixSystemProxySettings::Init()
 {
-  mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
-  if (mGSettings) {
-    mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
-                                       getter_AddRefs(mProxySettings));
-  }
-  if (!mProxySettings) {
-    mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+  // only use GSettings if that is a GNOME session
+  const char* sessionType = PR_GetEnv("DESKTOP_SESSION");
+  if (sessionType && !strcmp(sessionType, "gnome")) {
+    mGSettings = do_GetService(NS_GSETTINGSSERVICE_CONTRACTID);
+    if (mGSettings) {
+      mGSettings->GetCollectionForSchema(NS_LITERAL_CSTRING("org.gnome.system.proxy"),
+                                         getter_AddRefs(mProxySettings));
+    }
+    if (!mProxySettings) {
+      mGConf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
+    }
   }
 
   return NS_OK;
openSUSE Build Service is sponsored by