GNOME Bugzilla – Bug 688379
(regression) gnome-shell doesn't re-register NetworkAgent when NetworkManager is restarted
Last modified: 2012-11-20 13:03:11 UTC
Steps to reproduce: * Start session * Try to connect to a network which needs a password; e.g. a Wi-Fi network. * gnome-shell pops up the dialog to ask for the secrets; that's ok. * Now restart NetworkManager (e.g. sudo service NetworkManager restart or whatever applies in your distro). * Try to connect to a network which needs a password; e.g. a Wi-Fi network. * gnome-shell doesn't pop up the dialog to ask for the secrets; wrong. This issue seems to be introduced by the following commit: ------------------------------------------------------------ 2a800e4ce0912f098b4a469fc7a680ad094b3bfa Author: Jasper St. Pierre <jstpierre@mecheye.net> Date: Sun Sep 2 22:23:50 2012 -0300 Rearchitect the Shell to have a components system ------------------------------------------------------------ One of the changes done in the commit is moving from: this._native = new Shell.NetworkAgent({ auto_register: true, identifier: 'org.gnome.Shell.NetworkAgent' }); To: this._native = new Shell.NetworkAgent({ auto_register: false, identifier: 'org.gnome.Shell.NetworkAgent' }); Some other changes were added in the commit; like new enable() and disable() methods in the NetworkAgent object, likely to register() and unregister() the network agent, but I didn't find any place where these were being executed. If you relaunch NetworkManager with --log-level=DEBUG, you'll actually see that if using a gnome-shell snapshot before that commit we get the agent registered: [nm-agent-manager.c:297] impl_agent_manager_register(): (:1.253/org.gnome.Shell.NetworkAgent/1000) requesting permissions [nm-agent-manager.c:227] agent_register_permissions_done(): (:1.253/org.gnome.Shell.NetworkAgent/1000) agent registered But no such log will be given if using gnome-shell git master or just git at commit 2a800e4ce0912f098b4a469fc7a680ad094b3bfa. If you completely restart gnome-shell, though, it will register the agent correctly. Just on NM restart it won't re-register it, which it should.
BTW; I'm not suggesting a patch changing "auto_register: false" to "auto_register: true" because that's probably not the proper fix. Just understood now that the NetworkAgent is now a 'component', which is enabled or disabled (registered or unregistered from NM) based on the session mode, so it probably is not the case that it should always be re-registered. But, when thee component is supposed to be enabled according to the session mode, and the NetworkManager dbus name owner changes, the NetworkAgent really needs to re-register.
Created attachment 229101 [details] [review] Patch for the issue. The attached patch seems to fix the issue for me.
Review of attachment 229101 [details] [review]: Makes sense.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.