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>
pull/139/head
Peter Hutterer 2019-07-07 13:44:07 +10:00 committed by Benjamin Tissoires
parent 6ff9f34d08
commit caa52e0c51
1 changed files with 4 additions and 0 deletions

View File

@ -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: