8275071: [macos] A11y cursor gets stuck when combobox is closed
Backport-of: 5d249c46abc8dfdc3acdaff41d26f3bd9ba84731
diff --git a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java
index f6ebab0..15fc4d1 100644
--- a/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java
+++ b/src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java
@@ -164,24 +164,18 @@
treeNodeCollapsed(ptr);
}
- // At least for now don't handle combo box menu state changes.
- // This may change when later fixing issues which currently
- // exist for combo boxes, but for now the following is only
- // for JPopupMenus, not for combobox menus.
- if (parentRole != AccessibleRole.COMBO_BOX) {
- if (thisRole == AccessibleRole.POPUP_MENU) {
- if ( newValue != null &&
- ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
- menuOpened(ptr);
- } else if ( oldValue != null &&
- ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
- menuClosed(ptr);
- }
- } else if (thisRole == AccessibleRole.MENU_ITEM) {
- if ( newValue != null &&
- ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
- menuItemSelected(ptr);
- }
+ if (thisRole == AccessibleRole.POPUP_MENU) {
+ if ( newValue != null &&
+ ((AccessibleState)newValue) == AccessibleState.VISIBLE ) {
+ menuOpened(ptr);
+ } else if ( oldValue != null &&
+ ((AccessibleState)oldValue) == AccessibleState.VISIBLE ) {
+ menuClosed(ptr);
+ }
+ } else if (thisRole == AccessibleRole.MENU_ITEM) {
+ if ( newValue != null &&
+ ((AccessibleState)newValue) == AccessibleState.FOCUSED ) {
+ menuItemSelected(ptr);
}
}