[orca] Work around a missing state-changed event for Gtk+ submenus



commit 62d476a3881d748cd3bfb03ad2741a81aa51ebc7
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Dec 26 09:17:59 2013 -0500

    Work around a missing state-changed event for Gtk+ submenus

 src/orca/scripts/toolkits/GAIL/script.py |    5 +++++
 src/orca/scripts/toolkits/gtk/script.py  |    5 +++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/GAIL/script.py b/src/orca/scripts/toolkits/GAIL/script.py
index b224253..1dde092 100644
--- a/src/orca/scripts/toolkits/GAIL/script.py
+++ b/src/orca/scripts/toolkits/GAIL/script.py
@@ -49,6 +49,11 @@ class Script(default.Script):
             orca.setLocusOfFocus(event, event.source)
             return
 
+        # https://bugzilla.gnome.org/show_bug.cgi?id=720989
+        if role == pyatspi.ROLE_MENU == event.source.parent.getRole():
+            orca.setLocusOfFocus(event, event.source)
+            return
+
         # Unfiled. But this happens when you are in gtk-demo's application demo,
         # get into a menu and then press Escape. The text widget emits a focus:
         # event, but not a state-changed:focused event.
diff --git a/src/orca/scripts/toolkits/gtk/script.py b/src/orca/scripts/toolkits/gtk/script.py
index a029c38..cc35e9f 100644
--- a/src/orca/scripts/toolkits/gtk/script.py
+++ b/src/orca/scripts/toolkits/gtk/script.py
@@ -77,6 +77,11 @@ class Script(default.Script):
             orca.setLocusOfFocus(event, event.source)
             return
 
+        # https://bugzilla.gnome.org/show_bug.cgi?id=720989
+        if role == pyatspi.ROLE_MENU == event.source.parent.getRole():
+            orca.setLocusOfFocus(event, event.source)
+            return
+
         # Unfiled, but a similar case of the above issue with combo boxes.
         if role == pyatspi.ROLE_PUSH_BUTTON:
             orca.setLocusOfFocus(event, event.source)


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