[orca] Ignore focus: events coming from ancestor of locusOfFocus



commit 5000f953894efe1036e5e3ecdc6beb798768c974
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Mar 24 06:02:09 2017 -0400

    Ignore focus: events coming from ancestor of locusOfFocus

 src/orca/scripts/toolkits/GAIL/script.py |    3 +++
 src/orca/scripts/toolkits/gtk/script.py  |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index 5d5c8a3..0fe086d 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -75,6 +75,9 @@ class Script(default.Script):
         if self.utilities.isLayoutOnly(event.source):
             return
 
+        if pyatspi.findAncestor(orca_state.locusOfFocus, lambda x: x == event.source):
+            return
+
         orca.setLocusOfFocus(event, event.source)
 
     def onSelectionChanged(self, event):
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index 70d6448..80878bf 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -120,6 +120,9 @@ class Script(default.Script):
         if self.utilities.isLayoutOnly(event.source):
             return
 
+        if pyatspi.findAncestor(orca_state.locusOfFocus, lambda x: x == event.source):
+            return
+
         orca.setLocusOfFocus(event, event.source)
 
     def onFocusedChanged(self, event):


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