[orca] Don't depend on mouse release being emitted prior to caret-moved event



commit a434a24e9e64f00c9eaf6dd1c4bc37ae5700dfda
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue May 17 16:12:38 2022 +0200

    Don't depend on mouse release being emitted prior to caret-moved event
    
    When the user clicks and releases the primary mouse button and a caret-
    moved event is subsequently received, we present the line with the
    caret. However, we sometimes see the caret-moved event prior to the
    mouse-release event being fired. Therefore, if the caret moves and
    the last input event was either primary mouse click or primary mouse
    release, present the line.

 src/orca/scripts/default.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index cf9084a58..fd7dfba94 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -3103,10 +3103,11 @@ class Script(script.Script):
             self.sayLine(obj)
             return
 
-        if self.utilities.lastInputEventWasPrimaryMouseRelease():
+        if self.utilities.lastInputEventWasPrimaryMouseClick() \
+           or self.utilities.lastInputEventWasPrimaryMouseRelease():
             start, end, string = self.utilities.getCachedTextSelection(event.source)
             if not string:
-                msg = "DEFAULT: Presenting result of primary mouse button release"
+                msg = "DEFAULT: Presenting result of primary mouse button event"
                 debug.println(debug.LEVEL_INFO, msg, True)
                 self.sayLine(obj)
                 return


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]