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 764696 - Bluetooth switch does not update when turning off from shell
Bluetooth switch does not update when turning off from shell
Status: RESOLVED OBSOLETE
Product: gnome-control-center
Classification: Core
Component: Bluetooth
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 775711 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-04-06 21:05 UTC by Cosimo Cecchi
Modified: 2021-06-09 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
bluetooth: set switch off when BT airplane mode is enabled (2.26 KB, patch)
2016-04-06 21:11 UTC, Cosimo Cecchi
none Details | Review
bluetooth: Show a wait screen while bluetooth is being turned on (3.56 KB, patch)
2017-05-11 19:05 UTC, Benjamin Berg
rejected Details | Review
bluetooth: Show disabled screen with switch ON while transitioning (3.03 KB, patch)
2017-05-16 12:32 UTC, Benjamin Berg
none Details | Review
bluetooth: Show disabled screen with switch ON while transitioning (3.03 KB, patch)
2017-05-16 12:46 UTC, Benjamin Berg
none Details | Review

Description Cosimo Cecchi 2016-04-06 21:05:53 UTC
To reproduce:
- make sure bluetooth is enabled
- open bluetooth settings panel
- from the shell, turn off bluetooth

Expected results:
- the settings panel updates the page to mention that bluetooth is now off
- the switch on the bluetooth panel header turns off

Actual results:
- the settings panel correctly updates the page mentioning that bluetooth is now off
- the switch on the bluetooth panel header *does not* turn off

This seems to work fine in 3.18.2; the bug is introduced with this commit: https://git.gnome.org/browse/gnome-control-center/commit/panels/bluetooth/cc-bluetooth-panel.c?id=4a009da483e96ea1763855f419da64c9e2468a34

Since the shell only toggles off the BluetoothAirplaneMode property, that commit will make it so that the switch does not update.
Comment 1 Cosimo Cecchi 2016-04-06 21:11:23 UTC
Created attachment 325507 [details] [review]
bluetooth: set switch off when BT airplane mode is enabled

--

This seems to fix it for me, but I'm not sure if I'm missing something.
Comment 2 Bastien Nocera 2016-04-07 11:03:20 UTC
Pretty sure that's wrong, as it reverts my careful fix :)

Which version of gnome-bluetooth are you using? What type of device are you testing this on? The output of "rfkill list" would help see whether I can reproduce this on a machine with a similar configuration.

I tested this right now on a desktop with a single Bluetooth adapter right now, and it works fine:
$ rfkill list
0: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no
Comment 3 Cosimo Cecchi 2016-04-07 14:09:46 UTC
I can reproduce 100% of the time with the steps I described in comment #0 on Fedora 24 on my laptop.

With bluetooth on:

[cosimoc@yoga]$ rfkill list
0: ideapad_wlan: Wireless LAN
	Soft blocked: no
	Hard blocked: no
1: ideapad_bluetooth: Bluetooth
	Soft blocked: no
	Hard blocked: no
3: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
12: hci0: Bluetooth
	Soft blocked: no
	Hard blocked: no

When I turn it off from the shell:

[cosimoc@yoga]$ rfkill list
0: ideapad_wlan: Wireless LAN
	Soft blocked: no
	Hard blocked: no
1: ideapad_bluetooth: Bluetooth
	Soft blocked: yes
	Hard blocked: no
3: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
12: hci0: Bluetooth
	Soft blocked: yes
	Hard blocked: no
Comment 4 Cosimo Cecchi 2016-04-07 14:11:10 UTC
Oh, also the patch does not revert completely your fix - I left in place the connection to the "adapter-status-changed" signal.
Comment 5 Cosimo Cecchi 2016-04-21 07:02:32 UTC
Bastien, did you have any chance to take look at this?
Comment 6 Cosimo Cecchi 2016-09-01 22:52:07 UTC
Bastien, any news on this one?
Comment 7 Debarshi Ray 2016-12-01 09:02:01 UTC
I can reproduce this on a ThinkPad x220 and a 2nd generation X1.
Comment 8 Debarshi Ray 2016-12-06 14:15:28 UTC
*** Bug 775711 has been marked as a duplicate of this bug. ***
Comment 9 freeroot 2016-12-25 15:49:23 UTC
I have the same bug on my macbook.
Comment 10 Benjamin Berg 2017-05-11 19:05:28 UTC
Created attachment 351664 [details] [review]
bluetooth: Show a wait screen while bluetooth is being turned on

When rfkill is turned off it may take some time for the bluetooth device
to be ready (in particular if there is hardware power control as the USB
device needs to be registered first). During this time, show a special
page asking for the user to wait.
Comment 11 Benjamin Berg 2017-05-11 19:10:02 UTC
So, I think the logic for this check has been wrong much longer. The check did:

  bt_airplane_mode || !powered
  -> Default adapter is unpowered, but should be available

But it should be:
  !bt_airplane_mode && !powered

i.e. airplane mode is turned OFF, and the bluetooth dongle is not yet powered up.
Comment 12 Benjamin Berg 2017-05-11 19:35:25 UTC
I realised that we could deal with users getting stuck in a broken rfkill state by showing the button as "Off". That is not a great UI as the button will jump back to the "Off" state immediately after turning bluetooth on. However, it enables to escape a broken rfkill state (see bug #782532 for more details).

Thoughts?
Comment 13 Bastien Nocera 2017-05-16 09:20:38 UTC
Review of attachment 351664 [details] [review]:

No, a separate page is unnecessary and unwanted.
Comment 14 Benjamin Berg 2017-05-16 11:57:42 UTC
In old GNOME HIG times I remember a note that you should give feedback for anything taking longer than 100ms. And it can take in the range of seconds after you toggle the switch in the control center for bluetooth to become available.

I absolutely agree that not changing the UI in the stable branches is the right thing to do and was already planning to submit a separate patch for that purpose.
Comment 15 Bastien Nocera 2017-05-16 12:25:16 UTC
(In reply to Benjamin Berg from comment #14)
> In old GNOME HIG times I remember a note that you should give feedback for
> anything taking longer than 100ms. And it can take in the range of seconds
> after you toggle the switch in the control center for bluetooth to become
> available.

I'd rather have a spinner next to the switch, while the operation is ongoing. A separate page would be really jarring if the changes happen within a second...
Comment 16 Benjamin Berg 2017-05-16 12:32:23 UTC
Created attachment 351970 [details] [review]
bluetooth: Show disabled screen with switch ON while transitioning

When rfkill is turned off it may take some time for the bluetooth device
to be ready (in particular if there is hardware power control as the USB
device needs to be registered first). During this time show the switch
to be ON but still show the disabled page as not enough information is
available yet (in particular the bluetooth name).

--

This is a version without the UI change. Note that I forgot to remove the
change_powered boolean earlier and that is fixed in this revision.
Comment 17 Benjamin Berg 2017-05-16 12:46:52 UTC
Created attachment 351971 [details] [review]
bluetooth: Show disabled screen with switch ON while transitioning

When rfkill is turned off it may take some time for the bluetooth device
to be ready (in particular if there is hardware power control as the USB
device needs to be registered first). During this time show the switch
to be ON but still show the disabled page as not enough information is
available yet (in particular the bluetooth name).
Comment 18 Benjamin Berg 2017-05-16 12:49:23 UTC
Sorry, I had been experimenting with the UI a bit after submitting the patch so the last version accidentally set the switch state to FALSE instead of TRUE.

Now the logic should be sane.
Comment 19 André Klapper 2021-06-09 16:28:23 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new bug report at
  https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/

Thank you for your understanding and your help.