Skip to content

Commit 73ed814

Browse files
committed
1 parent 546191c commit 73ed814

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/jdk.accessibility/linux/classes/org/GNOME/Accessibility/AtkWrapper.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,17 @@ public void propertyChange(PropertyChangeEvent e) {
550550
return;
551551
}
552552

553+
/*
554+
* JComboBox sends two signals: object:active-descendant-changed and object:selection-changed.
555+
* Information about the component is announced when processing the object:selection-changed signal.
556+
* The object:active-descendant-changed signal interrupts this announcement in earlier versions of GNOME.
557+
* Skipping the emission of object:active-descendant-changed signal resolves this issue.
558+
* See: https://gitlab.gnome.org/GNOME/java-atk-wrapper/-/issues/29
559+
*/
560+
if (ac.getAccessibleRole() == AccessibleRole.COMBO_BOX) {
561+
return;
562+
}
563+
553564
Object[] args = new Object[1];
554565
args[0] = child_ac;
555566

@@ -572,6 +583,22 @@ public void propertyChange(PropertyChangeEvent e) {
572583
}
573584
}
574585

586+
/*
587+
* When navigating through nodes, JTree sends two signals: object:selection-changed and object:active-descendant-changed.
588+
* The object:selection-changed signal is emitted before object:active-descendant-changed, leading to the following issues:
589+
* 1. When focusing on the root of the tree, object:active-descendant-changed interrupts the announcement and does not
590+
* provide any output because the FOCUS MANAGER doesn't update the focus - it is already set to the same object.
591+
* 2. For other nodes, the correct behavior happens because of the bug in JTree:
592+
* AccessibleJTree incorrectly reports the selected children and object:selection-changed sets focus on the tree.
593+
*
594+
* Removing the object:selection-changed signal ensures that the locus of focus is updated during object:active-descendant-changed,
595+
* allowing elements to be announced correctly.
596+
* See: https://gitlab.gnome.org/GNOME/orca/-/issues/552
597+
*/
598+
if (ac.getAccessibleRole() == AccessibleRole.TREE) {
599+
return;
600+
}
601+
575602
if (!isTextEvent) {
576603
emitSignal(ac, AtkSignal.OBJECT_SELECTION_CHANGED, null);
577604
}

0 commit comments

Comments
 (0)