GNOME Bugzilla – Bug 647565
bluetooth extension doesn't show status change for device
Last modified: 2011-04-26 16:52:56 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
I can reproduce this locally with a Bluetooth trackpad.
Dup of bug 647223? (That is, does it work after restarting the shell?)
(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.
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.
(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.
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.
Review of attachment 185894 [details] [review]: Patch looks fine to me.
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.
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.
Attachment 186434 [details] pushed as 76fce94 - BluetoothStatus: always update devices