[orca] Explicitly set locus of focus to the selected item when a table emits focus:



commit eace1cc5c67f25c21a8d6933561e14a2d0a42141
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Nov 25 12:03:19 2013 -0500

    Explicitly set locus of focus to the selected item when a table emits focus:

 src/orca/scripts/toolkits/GAIL/script.py |    7 ++++++-
 src/orca/scripts/toolkits/gtk/script.py  |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index 8c2d29f..9843420 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -71,5 +71,10 @@ class Script(default.Script):
         # Unfiled, but yet another case of only getting a focus: event when
         # a widget appears in a parent container and is already focused.
         if role == pyatspi.ROLE_TABLE:
-            orca.setLocusOfFocus(event, event.source)
+            obj = event.source
+            selectedChildren = self.utilities.selectedChildren(obj)
+            if len(selectedChildren) == 1:
+                obj = selectedChildren[0]
+
+            orca.setLocusOfFocus(event, obj)
             return
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 8a2d9ba..426d460 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -99,5 +99,10 @@ class Script(default.Script):
         # a widget appears in a parent container and is already focused.
         # An example of this particular case is the list of elements dialogs.
         if role == pyatspi.ROLE_TABLE:
-            orca.setLocusOfFocus(event, event.source)
+            obj = event.source
+            selectedChildren = self.utilities.selectedChildren(obj)
+            if len(selectedChildren) == 1:
+                obj = selectedChildren[0]
+
+            orca.setLocusOfFocus(event, obj)
             return


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