Open nsmarkop opened 6 years ago
This is pretty unusual behavior; there shouldn't be anything in the code that focuses the drop-down when you type text, for example. Does the problem go away if you let both counts drop back to 0?
I can't reproduce it on my macOS computer. When I start typing, I can still select from the drop-down menu fine. It suggests to me that it might be a Qt bug. @benoit-pierre @morinted: have either of you seen behavior like this in Qt widgets?
Letting both counters drop back down to 0 doesn't resolve the issue. Though, I just went back to reproduce it again and by shrinking the window size I found it's actually putting the dropdown behind the window itself - it's not just closing / disappearing. Weird.
I see. Are you able to build from source? You could try adding a raise_
call after rendering the LCD displays to see if it fixes the issue. (Admittedly, I don't see why that would change things; we're re-rendering it every 1s regardless of whether its value has changed. Similarly, our pinning the window to the top should only have happened once at startup, so it shouldn't change when you start typing.)
I can install it from source, but I'm not familiar with QT at all to really know what the call is / where to add it and Python isn't the most helpful language for discovery there. If you can point out the exact changes I can go ahead and try them out to see if they help at all.
You can apply this patch:
diff --git a/plover_wpm_meter/__init__.py b/plover_wpm_meter/__init__.py
index 4c2ab1e..7c1db5a 100644
--- a/plover_wpm_meter/__init__.py
+++ b/plover_wpm_meter/__init__.py
@@ -81,6 +81,7 @@ class PloverWpmMeter(BaseMeter, Ui_WpmMeter):
chars = _filter_old_items(self.chars, timeout)
wpm = _wpm_of_chars(chars, method=self.wpm_method.currentData())
getattr(self, name).display(str(wpm))
+ self.wpm_method.raise_()
class PloverStrokesMeter(BaseMeter, Ui_StrokesMeter):
@@ -126,6 +127,7 @@ class PloverStrokesMeter(BaseMeter, Ui_StrokesMeter):
method=self.strokes_method.currentData()
)
getattr(self, name).display("{:0.2f}".format(strokes_per_word))
+ self.strokes_method.raise_()
def _timestamp_items(items):
I couldn't apply that as a patch for some reason, but I made the changes manually and it didn't seem to change any of the behavior after installing the modified plugin (I verified it was running the new code).
If you open the WPM meter you can freely select from the dropdown list as expected. However, once you start typing and try to change the selection it closes immediately. If you click where the selection would have been if the list hadn't closed then you are still able to select that entry. Closing and reopening the WPM meter seems to be the only way to resolve this behavior.
I'm on Windows 10 with Plover 4.0.0.dev6 and version 0.1.1 of the plugin.
A gif of the issue: