base: when search is turned off, remove unregistered devices again
This is what the dbusserver module does as well, so we end up with a weird mismatch: to the base module the device is still known and unregistered on the next search start. So when we see the bluez properties float past, we don't add a new devices. To the dbusserver the device is gone though and since we don't add it again in the base module, we never send a signal for it. Since there's a reasonable assumption that if we don't register the device, we don't want it anyway, let's delete it from the base device list too. This doesn't fix the issue of a device timing out while waiting for a button press. That device will count as known until the next search stop. But at least now we don't have to restart tuhi. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6ff9f34d08
commit
caa52e0c51
|
@ -300,6 +300,10 @@ class Tuhi(GObject.Object):
|
|||
self.bluez.stop_discovery()
|
||||
self._search_device_handler = None
|
||||
|
||||
unregistered = [addr for (addr, d) in self.devices.items() if not d.registered]
|
||||
for addr in unregistered:
|
||||
del self.devices[addr]
|
||||
|
||||
@classmethod
|
||||
def _device_in_register_mode(cls, bluez_device):
|
||||
if bluez_device.vendor_id not in WACOM_COMPANY_IDS:
|
||||
|
|
Loading…
Reference in New Issue