[orca] Present expanded-changed events for push buttons
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Present expanded-changed events for push buttons
- Date: Wed, 10 Oct 2018 18:12:39 +0000 (UTC)
commit 866da0395f37d4c1af3377b91ae9bbf44d830d5d
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Oct 10 14:11:42 2018 -0400
Present expanded-changed events for push buttons
src/orca/script_utilities.py | 20 ++++++++++++++++++++
src/orca/scripts/default.py | 3 +--
2 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 557d1b0ae..53ef64be9 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4762,6 +4762,26 @@ class Utilities:
return role in roles
+ def isPresentableExpandedChangedEvent(self, event):
+ if self.isSameObject(event.source, orca_state.locusOfFocus):
+ return True
+
+ try:
+ role = event.source.getRole()
+ state = event.source.getState()
+ except:
+ msg = "ERROR: Exception getting role and state of %s" % event.source
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return False
+
+ if role in [pyatspi.ROLE_TABLE_ROW, pyatspi.ROLE_COMBO_BOX]:
+ return True
+
+ if role == pyatspi.ROLE_PUSH_BUTTON:
+ return state.contains(pyatspi.STATE_FOCUSED)
+
+ return False
+
def isPresentableTextChangedEventForLocusOfFocus(self, event):
if not event.type.startswith("object:text-changed:") \
and not event.type.startswith("object:text-attributes-changed"):
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 2bf258e7f..b4a90598f 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -2304,8 +2304,7 @@ class Script(script.Script):
obj = event.source
role = obj.getRole()
- if not self.utilities.isSameObject(obj, orca_state.locusOfFocus) \
- and not role in [pyatspi.ROLE_TABLE_ROW, pyatspi.ROLE_COMBO_BOX]:
+ if not self.utilities.isPresentableExpandedChangedEvent(event):
return
oldObj, oldState = self.pointOfReference.get('expandedChange', (None, 0))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]