device: better gesture structure computation

This commit is contained in:
Peter F. Patel-Schneider 2022-01-14 10:37:07 -05:00
parent 7442c52c20
commit 56936a4d0a
1 changed files with 2 additions and 2 deletions

View File

@ -290,9 +290,9 @@ class Device:
@property @property
def gestures(self): def gestures(self):
if not self._gestures: if self._gestures is None:
with self._gestures_lock: with self._gestures_lock:
if not self._gestures: if self._gestures is None:
if self.online and self.protocol >= 2.0: if self.online and self.protocol >= 2.0:
self._gestures = _hidpp20.get_gestures(self) or () self._gestures = _hidpp20.get_gestures(self) or ()
return self._gestures return self._gestures