On Wed, 23 Nov 2022 02:16:31 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> I tried calling clearSelection again instead of adding an interface:
>> 
>>                 if (as == null) return;
>>                 if (pac.getAccessibleRole().equals(AccessibleRole.LIST)) {
>>                     as.clearAccessibleSelection();
>>                 }
>>                 as.addAccessibleSelection(i);
>> 
>> After that I changed the call to 
>> ```javax.swing.JList.AccessibleJList#addAccessibleSelection```
>> 
>> JList.this.addSelectionInterval(i, i);
>> 
>> on the
>> 
>> JList.this.getSelectionModel().setSelectionInterval(i, i);
>> 
>> Nothing changed. VoiceOVer still freezes.
>> I think that the problem is not that setting the selection doesn't work, but 
>> that clearing the selection before setting causes the VO to fris.
>
> Some probably related points, the implementation of the 
> addAccessibleSelection for the JComboBox. is the same:
> 
>             clearAccessibleSelection();
>             JComboBox.this.setSelectedIndex(i);
> 
> 
> It is possible that it also hangs?

>I think that the problem is not that setting the selection doesn't work, but 
>that clearing the selection before setting causes the VO to fris.

Are you sure that the selection should be always cleared in this method, how it 
will work if the jlist supports multiline selection? Or voice over does not 
support multyline selection?

As a fix, you can delete listeners from the jlist so your request to clear the 
current selection will not be sent back to the voiceover. Or you can add a new 
method to the AccessibleSelection interface with the default implementation 
"clearAccessibleSelection+addAccessibleSelection". Then override it in the 
jlist to call setSelectedIndex().

-------------

PR: https://git.openjdk.org/jdk/pull/8578

Reply via email to