Don't start listening twice

We get a notification for listening going to True after start_listening(), but
we don't need to start it again in that case.
This commit is contained in:
Peter Hutterer 2019-07-11 20:18:17 +10:00
parent 82f62059f0
commit 0ce60deb34
1 changed files with 6 additions and 2 deletions

View File

@ -82,8 +82,12 @@ class DrawingPerspective(Gtk.Stack):
return "drawing_perspective" return "drawing_perspective"
def _on_connected(self, device, pspec): def _on_connected(self, device, pspec):
# Turns out we don't really care about whether the device is
# connected or not, it has little effect on how we work here
pass pass
def _on_listening_stopped(self, device, pspec): def _on_listening_stopped(self, device, pspec):
# We never want to stop listening if not device.listening:
device.start_listening() logger.debug(f'{device.name} - listening stopped, restarting')
# We never want to stop listening
device.start_listening()