[orca] More aggressively verify if a message is from a focused chat



commit a21b96bd90bf63936ccb1f01947884cb80c3e174
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Aug 9 11:48:41 2016 -0400

    More aggressively verify if a message is from a focused chat

 src/orca/chat.py |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/chat.py b/src/orca/chat.py
index f8a8ba0..af7706e 100644
--- a/src/orca/chat.py
+++ b/src/orca/chat.py
@@ -28,6 +28,7 @@ __license__   = "LGPL"
 import pyatspi
 
 from . import cmdnames
+from . import debug
 from . import guilabels
 from . import input_event
 from . import keybindings
@@ -853,10 +854,13 @@ class Chat:
         """
 
         if obj and obj.getState().contains(pyatspi.STATE_SHOWING):
-            topLevel = self._script.utilities.topLevelObject(obj)
-            if topLevel and topLevel.getState().contains(pyatspi.STATE_ACTIVE):
-                return True
+            active = self._script.utilities.topLevelObjectIsActiveAndCurrent(obj)
+            msg = "INFO: %s's is focused chat: %s" % (obj, active)
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return active
 
+        msg = "INFO: %s is not focused chat" % obj
+        debug.println(debug.LEVEL_INFO, msg, True)
         return False
 
     def getChatRoomName(self, obj):


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