Skip to content

8377936: VoiceOver Reads Button Incorrectly#30641

Open
mickleness wants to merge 1 commit intoopenjdk:masterfrom
mickleness:8377936
Open

8377936: VoiceOver Reads Button Incorrectly#30641
mickleness wants to merge 1 commit intoopenjdk:masterfrom
mickleness:8377936

Conversation

@mickleness
Copy link
Copy Markdown
Contributor

@mickleness mickleness commented Apr 9, 2026

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8377936: VoiceOver Reads Button Incorrectly (Bug - P5)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30641/head:pull/30641
$ git checkout pull/30641

Update a local copy of the PR:
$ git checkout pull/30641
$ git pull https://git.openjdk.org/jdk.git pull/30641/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30641

View PR using the GUI difftool:
$ git pr show -t 30641

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30641.diff

Using Webrev

Link to Webrev Comment

The crux of 8377936 was:
VoiceOver would request to transfer the keyboard focus from X to Y.
This caused X to lose keyboard focus.
VoiceOver would (imperceptibly briefly) start to announce Y, and then Swing would fire an AccessibleStateSet change because X lost its FOCUSABLE state.
This notified CAccessible's AXChangeNotifier because the AccessibleStateSet changed, and it would call `valueChanged`.
So VoiceOver immediately re-announced X (instead of its expected behavior: it should finish announcing Y and ignore X.)
@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 9, 2026

👋 Welcome back jwood! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 9, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Apr 9, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 9, 2026

@mickleness The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 9, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 9, 2026

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client client-libs-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant