[orca/gnome-3-36] Don't present position in list for comboboxes which lack children
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/gnome-3-36] Don't present position in list for comboboxes which lack children
- Date: Fri, 10 Apr 2020 19:43:57 +0000 (UTC)
commit caf4322168803efbc461ea3bceb4659f14df3efe
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Apr 10 15:40:23 2020 -0400
Don't present position in list for comboboxes which lack children
Some comboboxes don't have their menu or listbox children until
the combobox is expanded. In this case, we were falling back on
the normal position in list calculation which makes no sense when
we cannot get the list of children.
src/orca/script_utilities.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 57ca64e99..106e1274c 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4713,10 +4713,12 @@ class Utilities:
if selected:
obj = selected[0]
else:
- isMenu = lambda x: x and x.getRole() == pyatspi.ROLE_MENU
+ isMenu = lambda x: x and x.getRole() in [pyatspi.ROLE_MENU, pyatspi.ROLE_LIST_BOX]
selected = self.selectedChildren(pyatspi.findDescendant(obj, isMenu))
if selected:
obj = selected[0]
+ else:
+ return -1, -1
parent = self.getFunctionalParent(obj)
childCount = self.getFunctionalChildCount(parent)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]