[orca] Fall back on the active window when presenting the title bar of defunct object



commit bfaad29d9691aeb633d929e7fcfe487db46b9043
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Apr 28 22:03:15 2018 -0400

    Fall back on the active window when presenting the title bar of defunct object

 src/orca/script_utilities.py |    3 +++
 src/orca/scripts/default.py  |   10 +++++++++-
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index b3cf625..45f9f9c 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -584,6 +584,9 @@ class Utilities:
 
         results = [None, None]
 
+        if obj.getRole() == pyatspi.ROLE_FRAME:
+            results[0] = obj
+
         parent = obj.parent
         while parent and (parent.parent != parent):
             if parent.getRole() == pyatspi.ROLE_FRAME:
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 5d0b1ce..adf61a2 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -1251,7 +1251,15 @@ class Script(script.Script):
     def presentTitle(self, inputEvent):
         """Speaks and brailles the title of the window with focus."""
 
-        title = self.speechGenerator.generateTitle(orca_state.locusOfFocus)
+        obj = orca_state.locusOfFocus
+        if self.utilities.isDead(obj):
+            obj = orca_state.activeWindow
+
+        if not obj or self.utilities.isDead(obj):
+            self.presentMessage(messages.LOCATION_NOT_FOUND_FULL)
+            return True
+
+        title = self.speechGenerator.generateTitle(obj)
         for (string, voice) in title:
             self.presentMessage(string, voice=voice)
 


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