I'm setting auto pac proxy settings (autoconfig-url) within a C++ program using gsettings and see that the Network Manager GUI Proxy Settings are out of sync with gsettings. In addition, after closing the Network Manager GUI it overrides the proxy settings in gsettings.
Steps to Reproduce
1a. Programmatically set gsettings (System call)
std::string cmd = "gsettings set org.gnome.system.proxy mode auto";
system(cmd.c_str());
cmd = "gsettings set org.gnome.system.proxy autoconfig-url http://1.2.3.4/proxy.pac";
system(cmd.c_str());
OR
1b. Programmatically set gsettings (GTK lib)
GSettings *settings;
settings = g_settings_new ("org.gnome.system.proxy");
g_settings_set_string(settings, "mode", "auto");
g_settings_set_string(settings, "autoconfig-url", "http://1.2.3.4/proxy.pac");
g_settings_sync();
- Opened terminal and read back gsettings to verify
$ gsettings get org.gnome.system.proxy mode
'auto'
$ gsettings get org.gnome.system.proxy autoconfig-url
'http://1.2.3.4/proxy.pac'
- Opened Network Manager GUI in Settings and saw not in sync with gsettings.
- Close Network Manager GUI.
- Read back gsettings to find that the gsettings proxy settings have been overwritten by closing Network Manager GUI. Even if no updates were made.
$ gsettings get org.gnome.system.proxy mode
'none'
$ gsettings get org.gnome.system.proxy autoconfig-url
''
I tested on Ubuntu 18.04 and 20.04 and I see the Network Manager GUI in sync with gsettings. I see this issue mainly on RHEL/CentOS 8.