On Thu, 9 Apr 2026 05:40:14 GMT, Jeremy Wood <[email protected]> wrote:
> With this PR: > We call `CAccessible.valueChanged` when we believe the value changed, not > when the AccessibleStateSet changed. > > Although this is a small refactor: it touches parts of code that span > approximately a decade of different bug fixes. At least one of these older > bugs was a P2. I tried to note the related issues in the test for reference. > (Also in my testing I confirmed JRadioButtons and JToggleButtons work as > expected, but I kept the final test simple for the convenience of human > testers.) > > In 8377936 the problem was: > > We had two components, X and Y. When VO transferred the focus from X to Y, it > would (ever so briefly) start to announce Y.** Then Swing would update X's > AccessibleContext to inform it that X was no longer focused, therefore X's > AccessibleStateSet changed. This triggered CAccessible's AXChangeNotifier, > which called `CAccessible.valueChanged`. This resulted in VoiceOver > announcing X's state (as if it thought the selected state changed), even > though the keyboard focus was now on Y. > > The AXChangeNotifier was probably intending to call `valueChanged` only when > AccessibleState.SELECTED or CHECKED or something important was updated. The > fact that it called `valueChanged` for AccessibleState.FOCUSED is probably an > oversight***. > > ** If you comment out the line in CAccessibility.requestFocus that actually > requests the focus: then VoiceOver announced Y correctly. But this left the > keyboard focus on the wrong component. > > *** I also tested triggering AccessibleState.FOCUSABLE, > AccessibleState.VISIBLE, and a few other states; none of them resulted in a > comparable bug, though. The code you are deleting was added by these two fixes. ============= commit eefbaa29567f89e0c28425fe4ed4bddef3a14891 Author: Abhishek Kumar <[email protected]> Date: Thu Mar 16 05:00:40 2023 +0000 8283400: [macos] a11y : Screen magnifier does not reflect JRadioButton value change commit ec5f10e6a2fa4dc593a972e479604ef60b647d56 Author: Shashidhara Veerabhadraiah <[email protected]> Date: Mon Oct 15 10:29:06 2018 +0530 8061359: [macosx] Checkbox toggles on Space press but does not spoken by Voice Over =========== I don't know if these are included in what you reviewed. Can you confirm this change doesn't regress them ? ------------- PR Comment: https://git.openjdk.org/jdk/pull/30641#issuecomment-4232854252
