GNOME Bugzilla – Bug 709641
After turning off wireless or hotspot, the list of wifi networks / access points are not visible until the gnome-control-center dialog is re-opened
Last modified: 2016-04-05 06:26:01 UTC
Created attachment 256733 [details] bug demonstration video If I enable wifi card from the control center, I don't see any wireless networks, even though I can display them using the top-right user menu. The networks are visible only when I go back to the control center main screen and open the network dialog again. control-center-3.10.0-1.fc20.x86_64 NetworkManager-0.9.9.0-12.git20130913.fc20.x86_64
I'm definitely seeing that too, on 3.10, 3.12 and 3.14. Disabling (and re-enabling) wireless in the network settings results in the wireless networks list never refreshing until you close and reopen the control center. Not sure if bug #692127 is a duplicate or if that one is a different variant.
I'm seeing this problem, too. I spent some time to investigate it and found what the problem is. g-c-c tries to fetch the list of APs right after the user clicks the switch button(from off to on). The AP list from NetworkManager is not ready yet at that moment, so g-c-c fails to show the list of APs.
Created attachment 323842 [details] [review] Fix Wifi list not showing APs correctly Pause a few seconds after turning the switch button from OFF to ON to wait AP list to be generated. Please review it.
Created attachment 324733 [details] [review] Fix Wifi list not showing APs Use g_timeout_add_full to make a function called at a regular interval to check if aps is generated or not.
Thanks for the patch! Unfortunately using a timeout to poll the list of APs isn't the right fix. The problem here is that we should be using NMDeviceWifi's access-point-added and access-point-removed signals to update the list dynamically instead of running populate_ap_list() at specific points. Can you prepare a patch along those lines?
(In reply to Rui Matos from comment #5) > Thanks for the patch! Unfortunately using a timeout to poll the list of APs > isn't the right fix. > > The problem here is that we should be using NMDeviceWifi's > access-point-added and access-point-removed signals to update the list > dynamically instead of running populate_ap_list() at specific points. Can > you prepare a patch along those lines? Thanks for the reply. Sure, I'll work on a new patch.
Created attachment 324913 [details] [review] Fix empty wifi list Add a callback function for "AccessPointAdded" signal to update the Wifi list.
Created attachment 324916 [details] [review] Fix empty wifi list Add a callback function for "AccessPointAdded" signal to update the Wifi list. Modify the code a bit compared with last patch.
Review of attachment 324916 [details] [review]: 1. please follow the indentation and curly brace style of the rest of the code 2. the NMDeviceWifi class already has gobject signals access-point-added/removed that you can use, no need to use DBus directly 3. we should also handle access-point-removed
Created attachment 325058 [details] [review] Fix empty wifi list Patch updated. Added callback for signals "access-point-added" and "access-point-removed" of NMDeviceWifi. Follow the overall coding style.
Review of attachment 325058 [details] [review]: Please re-do the patch on top of master, not on top of whatever patches you have locally ::: panels/network/net-device-wifi.c @@ +256,3 @@ static void +net_device_wifi_access_point_changed (NMDeviceWifi *nm_device_wifi, + GParamSpec *pspec, This is not the right signature for this signal handler @@ +263,3 @@ + device_wifi = NET_DEVICE_WIFI (user_data); + + nm_device_wifi_refresh_ui (device_wifi); For APs added/removed we don't need to run the whole refresh_ui(), just call populate_ap_list() @@ +1348,3 @@ + g_signal_connect (nm_device, "access-point-added", + G_CALLBACK (net_device_wifi_access_point_changed), + device_wifi); I'd prefer that you used g_signal_connect_object() to be safe
Created attachment 325103 [details] [review] Fix empty wifi list Patch updated.
Created attachment 325106 [details] [review] Fix empty wifi list Patch updated. @Rui I think I didn't quite understand your saying "This is not the right signature for this signal handler". Can you explain that a bit more.
Created attachment 325107 [details] [review] Fix empty wifi list Patch updated.
Review of attachment 325107 [details] [review]: Code looks good now. Please change the patch subject so that it identifies the panel (network: Fix...) before pushing
Patch pushed to master as commit 28c54f3d551af09c414fbf2e2e13a9f7b61781f9. Closing this bug.