[orca] Mouse Review: Don't take active doc into account unless obj is in a document



commit c3527ed6ec0c19c760de258006bed6cb21637b9e
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Oct 28 11:48:50 2019 -0400

    Mouse Review: Don't take active doc into account unless obj is in a document

 src/orca/mouse_review.py | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/src/orca/mouse_review.py b/src/orca/mouse_review.py
index 6787a1ed0..b6653e813 100644
--- a/src/orca/mouse_review.py
+++ b/src/orca/mouse_review.py
@@ -490,10 +490,6 @@ class MouseReviewer:
                 debug.println(debug.LEVEL_INFO, msg, True)
                 menu = None
 
-        document = None
-        if script.utilities.inDocumentContent():
-            document = script.utilities.activeDocument()
-
         screen, nowX, nowY = self._pointer.get_position()
         if (pX, pY) != (nowX, nowY):
             msg = "MOUSE REVIEW: Pointer moved again: (%i, %i)" % (nowX, nowY)
@@ -501,7 +497,6 @@ class MouseReviewer:
             return
 
         obj = script.utilities.descendantAtPoint(menu, pX, pY) \
-            or script.utilities.descendantAtPoint(document, pX, pY) \
             or script.utilities.descendantAtPoint(window, pX, pY)
         msg = "MOUSE REVIEW: Object at (%i, %i) is %s" % (pX, pY, obj)
         debug.println(debug.LEVEL_INFO, msg, True)
@@ -513,10 +508,13 @@ class MouseReviewer:
                 debug.println(debug.LEVEL_INFO, msg, True)
                 return
 
-        if document and obj and document != script.utilities.getContainingDocument(obj):
-            msg = "MOUSE REVIEW: %s is not in active document %s" % (obj, document)
-            debug.println(debug.LEVEL_INFO, msg, True)
-            return
+        objDocument = script.utilities.getContainingDocument(obj)
+        if objDocument and script.utilities.inDocumentContent():
+            document = script.utilities.activeDocument()
+            if document != objDocument:
+                msg = "MOUSE REVIEW: %s is not in active document %s" % (obj, document)
+                debug.println(debug.LEVEL_INFO, msg, True)
+                return
 
         if obj and obj.getRole() in script.utilities.getCellRoles() \
            and script.utilities.shouldReadFullRow(obj):


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