After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
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
After turning off wireless or hotspot, the list of wifi networks / access poi...
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Network
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-08 13:14 UTC by Kamil Páral
Modified: 2016-04-05 06:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bug demonstration video (560.00 KB, video/webm)
2013-10-08 13:14 UTC, Kamil Páral
  Details
Fix Wifi list not showing APs correctly (1.53 KB, patch)
2016-03-14 09:42 UTC, Jonathan Kang
none Details | Review
Fix Wifi list not showing APs (3.58 KB, patch)
2016-03-25 00:51 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (3.83 KB, patch)
2016-03-29 02:35 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (3.83 KB, patch)
2016-03-29 03:12 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (1.83 KB, patch)
2016-03-31 01:58 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (1.92 KB, patch)
2016-03-31 17:41 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (1.97 KB, patch)
2016-03-31 17:54 UTC, Jonathan Kang
none Details | Review
Fix empty wifi list (1.97 KB, patch)
2016-03-31 18:05 UTC, Jonathan Kang
committed Details | Review

Description Kamil Páral 2013-10-08 13:14:41 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
Comment 1 Jean-François Fortin Tam 2014-12-19 16:14:49 UTC
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.
Comment 2 Jonathan Kang 2016-03-11 10:22:03 UTC
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.
Comment 3 Jonathan Kang 2016-03-14 09:42:49 UTC
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.
Comment 4 Jonathan Kang 2016-03-25 00:51:41 UTC
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.
Comment 5 Rui Matos 2016-03-26 17:20:42 UTC
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?
Comment 6 Jonathan Kang 2016-03-28 01:30:06 UTC
(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.
Comment 7 Jonathan Kang 2016-03-29 02:35:48 UTC
Created attachment 324913 [details] [review]
Fix empty wifi list

Add a callback function for "AccessPointAdded" signal to update the Wifi list.
Comment 8 Jonathan Kang 2016-03-29 03:12:29 UTC
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.
Comment 9 Rui Matos 2016-03-30 19:15:55 UTC
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
Comment 10 Jonathan Kang 2016-03-31 01:58:51 UTC
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.
Comment 11 Rui Matos 2016-03-31 15:05:40 UTC
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
Comment 12 Jonathan Kang 2016-03-31 17:41:51 UTC
Created attachment 325103 [details] [review]
Fix empty wifi list

Patch updated.
Comment 13 Jonathan Kang 2016-03-31 17:54:26 UTC
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.
Comment 14 Jonathan Kang 2016-03-31 18:05:16 UTC
Created attachment 325107 [details] [review]
Fix empty wifi list

Patch updated.
Comment 15 Rui Matos 2016-04-01 14:07:54 UTC
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
Comment 16 Jonathan Kang 2016-04-05 06:25:36 UTC
Patch pushed to master as commit 28c54f3d551af09c414fbf2e2e13a9f7b61781f9.

Closing this bug.