[orca] Handle the destruction and repopulation of Gedit's suggestions-list items



commit ffed617d352f41d4ab9b4a3ded2c28bf328680fa
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 19 14:21:50 2014 -0500

    Handle the destruction and repopulation of Gedit's suggestions-list items

 src/orca/scripts/apps/gedit/script.py |   18 +++++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/apps/gedit/script.py b/src/orca/scripts/apps/gedit/script.py
index b5b468c..ade4159 100644
--- a/src/orca/scripts/apps/gedit/script.py
+++ b/src/orca/scripts/apps/gedit/script.py
@@ -110,8 +110,24 @@ class Script(gtk.Script):
             gtk.Script.onNameChanged(self, event)
             return
 
-        if event.source.name == self.spellcheck.getMisspelledWord():
+        name = event.source.name
+        if name == self.spellcheck.getMisspelledWord():
             self.spellcheck.presentErrorDetails()
+            return
+
+        parent = event.source.parent
+        if parent != self.spellcheck.getSuggestionsList() \
+           or not parent.getState().contains(pyatspi.STATE_FOCUSED):
+            return
+
+        entry = self.spellcheck.getChangeToEntry()
+        if name != self.utilities.displayedText(entry):
+            return
+
+        # If we're here, the locusOfFocus was in the selection list when
+        # that list got destroyed and repopulated. Focus is still there.
+        orca.setLocusOfFocus(event, event.source, False)
+        self.updateBraille(orca_state.locusOfFocus)
 
     def onSensitiveChanged(self, event):
         """Callback for object:state-changed:sensitive accessibility events."""


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