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 647565 - bluetooth extension doesn't show status change for device
bluetooth extension doesn't show status change for device
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.0.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-12 15:16 UTC by Frederic Crozat
Modified: 2011-04-26 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
BluetoothStatus: always update devices (5.01 KB, patch)
2011-04-13 17:11 UTC, Giovanni Campagna
needs-work Details | Review
BluetoothStatus: always update devices (4.88 KB, patch)
2011-04-21 15:07 UTC, Giovanni Campagna
committed Details | Review

Description Frederic Crozat 2011-04-12 15:16:31 UTC
when connecting a bluetooth headset, it doesn't appear as connected in bluetooth gnome-shell extension, although it appears correctly as connected in bluetooth gnome-control-center panel or in bluetooth-applet
Comment 1 Bastien Nocera 2011-04-12 15:26:35 UTC
I can reproduce this locally with a Bluetooth trackpad.
Comment 2 Owen Taylor 2011-04-12 16:47:59 UTC
Dup of bug 647223? (That is, does it work after restarting the shell?)
Comment 3 Bastien Nocera 2011-04-12 17:43:22 UTC
(In reply to comment #2)
> Dup of bug 647223? (That is, does it work after restarting the shell?)

Device != Adapter in Bluetooth parlance. One is the Bluetooth dongle (Adapter), the other the "remote" device you're connecting to (Device).

Here it's the connection status of individual devices which isn't updated.
Comment 4 Bastien Nocera 2011-04-12 17:53:59 UTC
I don't actually see any code in bluetooth.js to update the status of the connection. _createDeviceItem() is the only time that ConnectionState is used.
Comment 5 Giovanni Campagna 2011-04-12 18:37:27 UTC
(In reply to comment #4)
> I don't actually see any code in bluetooth.js to update the status of the
> connection. _createDeviceItem() is the only time that ConnectionState is used.

Yes, I've just noticed that too, and I'll soon attach a patch to fix it.
Comment 6 Giovanni Campagna 2011-04-13 17:11:43 UTC
Created attachment 185894 [details] [review]
BluetoothStatus: always update devices

Previously, we skipped rebuilding device items in case the device
had already been seen, but this caused the connected switch not to
be updated. Now it has been refactored to update in case the device
changes, and to create only when the device is completely new.
Comment 7 Bastien Nocera 2011-04-13 17:21:51 UTC
Review of attachment 185894 [details] [review]:

Patch looks fine to me.
Comment 8 Dan Winship 2011-04-14 21:02:54 UTC
Comment on attachment 185894 [details] [review]
BluetoothStatus: always update devices

>+                if (item._device.device_path == devices[j].device_path) {
>+                    this._updateDeviceItem(item, devices[j]);
>+                    devices[j]._item = item;

I think the last line is wrong; _updateDeviceItem() will set devices[j]._item itself if everything is ok, and will destroy it if not.

>+        // adopt the device object, and add a back link
>+        // (it doesn't matter if it is a cycle, it can be collected by the GC)

Don't really need that second line.


Otherwise looks good, but I haven't tested it.
Comment 9 Giovanni Campagna 2011-04-21 15:07:45 UTC
Created attachment 186434 [details] [review]
BluetoothStatus: always update devices

Previously, we skipped rebuilding device items in case the device
had already been seen, but this caused the connected switch not to
be updated. Now it has been refactored to update in case the device
changes, and to create only when the device is completely new.
Comment 10 Giovanni Campagna 2011-04-26 16:52:51 UTC
Attachment 186434 [details] pushed as 76fce94 - BluetoothStatus: always update devices