Closed dmitrii-drobotov closed 3 months ago
I've added the test, and also ported the change to the copy of AccessibleJTreeNode
in AccessBridge.java. Turns out it's used instead of the normal AccessibleJTreeNode
in case when tree is the parent of the node: https://github.com/JetBrains/JetBrainsRuntime/blob/b3cd00363f3e6022b6fb47823c0128c7f5d86798/src/jdk.accessibility/windows/classes/com/sun/java/accessibility/internal/AccessBridge.java#L5469-L5479
It passes null
as accessible parent argument, so needs to be fixed it the same way. With this additional fix in AccessBridge, the JDK-8249806 is completely fixed.
Before fix:
After:
This fixes an issue with
AccessibleJTreeNode#getBounds
, which adjusts the node's bounds according to the parent node: https://github.com/JetBrains/JetBrainsRuntime/blob/ce6f4d023beef597cb670072e093eeb0fb25dfd5/src/java.desktop/share/classes/javax/swing/JTree.java#L5425-L5437For nodes whose parent is the invisible root,
getBounds
was returning null, and it caused issues with assistive technology like macOS Accessibility Zoom.This also matches behavior in
AccessibleJTree#getAccessibleChild
which creates accessible node for the root only if it's visible:https://github.com/JetBrains/JetBrainsRuntime/blob/ce6f4d023beef597cb670072e093eeb0fb25dfd5/src/java.desktop/share/classes/javax/swing/JTree.java#L4541-L4575
Before
Invisible root has an item in the hierarchy:
In IntelliJ it caused issues with macOS Accessibility Zoom when selecting top level nodes:
https://github.com/JetBrains/JetBrainsRuntime/assets/102954094/e689c409-19a2-4341-a92d-b7b78e1a03ae
After
No item in the hierarchy for the invisible root:
Issues with macOS Accessibility Zoom when selecting top level nodes are fixed:
https://github.com/JetBrains/JetBrainsRuntime/assets/102954094/002daa88-6c8a-48d1-ad69-c27e3f67b3fd