From 6c02417037e148142b609bea2d535bac17271f14 Mon Sep 17 00:00:00 2001 From: "Peter F. Patel-Schneider" Date: Thu, 17 Mar 2022 13:32:01 -0400 Subject: [PATCH] ui: allow tray icon to scroll whenever at least two devices --- lib/solaar/ui/tray.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/solaar/ui/tray.py b/lib/solaar/ui/tray.py index e488f8c3..876ae3a4 100644 --- a/lib/solaar/ui/tray.py +++ b/lib/solaar/ui/tray.py @@ -84,9 +84,7 @@ def _scroll(tray_icon, event, direction=None): # ignore all other directions return - if len(_devices_info) < 4: - # don't bother with scrolling when there's only one receiver - # with only one or two devices + if sum(map(lambda i: i[1] is not None, _devices_info)) < 2: # don't bother even trying to scroll if less than two devices return # scroll events come way too fast (at least 5-6 at once)