[orca] Use isSameObject() rather than a simple equality check for active-changed events



commit d626d159d5acfc9a351e69f54c865e96d5e213c8
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Feb 18 16:36:15 2016 -0500

    Use isSameObject() rather than a simple equality check for active-changed events

 src/orca/scripts/default.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 33c7910..b1d58cd 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2078,13 +2078,16 @@ class Script(script.Script):
         """Callback for object:state-changed:active accessibility events."""
 
         if event.source.getRole() == pyatspi.ROLE_FRAME:
-            if event.source == orca_state.activeWindow and not event.detail1:
+            sourceIsActiveWindow = self.utilities.isSameObject(
+                event.source, orca_state.activeWindow)
+
+            if sourceIsActiveWindow and not event.detail1:
                 msg = "DEFAULT: Event is for active window. Clearing state."
                 debug.println(debug.LEVEL_INFO, msg, True)
                 orca_state.activeWindow = None
                 return
 
-            if event.detail1 and not event.source == orca_state.activeWindow:
+            if not sourceIsActiveWindow and event.detail1:
                 msg = "DEFAULT: Updating active window to event source."
                 debug.println(debug.LEVEL_INFO, msg, True)
                 self.windowActivateTime = time.time()


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