[orca] 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] Don't present position in list for comboboxes which lack children
- Date: Fri, 10 Apr 2020 19:43:30 +0000 (UTC)
commit 3683be9bd857b2a057667a1fd289957d5e019306
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 4808db024..260b4f9db 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4779,10 +4779,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]