Skip to content

Commit 97d8ed2

Browse files
committedDec 18, 2023
8309733: [macOS, Accessibility] VoiceOver: Incorrect announcements of JRadioButton
Backport-of: d1d2b55ce0b950e07f6e3761983f73fd58079627
1 parent 48c8478 commit 97d8ed2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/java.desktop/macosx/classes/sun/lwawt/macosx/CAccessible.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -182,17 +182,23 @@ public void propertyChange(PropertyChangeEvent e) {
182182

183183
// Do send check box state changes to native side
184184
if (thisRole == AccessibleRole.CHECK_BOX) {
185-
valueChanged(ptr);
185+
if (newValue != null && !newValue.equals(oldValue)) {
186+
valueChanged(ptr);
187+
}
186188
}
187189

188190
// Do send radio button state changes to native side
189191
if (thisRole == AccessibleRole.RADIO_BUTTON) {
190-
valueChanged(ptr);
192+
if (newValue != null && !newValue.equals(oldValue)) {
193+
valueChanged(ptr);
194+
}
191195
}
192196

193197
// Do send toggle button state changes to native side
194198
if (thisRole == AccessibleRole.TOGGLE_BUTTON) {
195-
valueChanged(ptr);
199+
if (newValue != null && !newValue.equals(oldValue)) {
200+
valueChanged(ptr);
201+
}
196202
}
197203
} else if (name.equals(ACCESSIBLE_NAME_PROPERTY)) {
198204
//for now trigger only for JTabbedPane.

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Dec 18, 2023

@openjdk-notifier[bot]
Please sign in to comment.