[orca] Eliminate false positive with clipboard notification



commit fc5d1f07f701381dc44f2749313554b1134a02e0
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Mar 1 18:06:06 2016 -0500

    Eliminate false positive with clipboard notification

 src/orca/scripts/web/script_utilities.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 07e7f16..7890610 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3032,6 +3032,25 @@ class Utilities(script_utilities.Utilities):
         if not self.inDocumentContent():
             return False
 
+        topLevel = self.topLevelObject(orca_state.locusOfFocus)
+        if not topLevel:
+            return False
+
+        topLevel.clearCache()
+        try:
+            state = topLevel.getState()
+        except:
+            msg = "WEB: Exception getting state of topLevel %s" % topLevel
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return False
+
+        if not state.contains(pyatspi.STATE_ACTIVE) \
+           or state.contains(pyatspi.STATE_DEFUNCT):
+            return False
+
+        if not self.isSameObject(topLevel, orca_state.activeWindow):
+            return False
+
         if 'Action' in pyatspi.listInterfaces(orca_state.locusOfFocus):
             msg = "WEB: Treating %s as source of copy" % orca_state.locusOfFocus
             debug.println(debug.LEVEL_INFO, msg, True)


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