RFR: 8291087: Wrong position of focus of screen reader on Windows with screen scale > 1 [v2]
Kevin Rushforth
kcr at openjdk.org
Fri Aug 5 18:54:14 UTC 2022
On Fri, 5 Aug 2022 18:42:34 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> When using the Windows Narrator screen reader on a Hi-DPI screen, the visible focus is drawn in the wrong location and with the wrong size. This happens because the the JavaFX Windows accessibility code that returns the screen bounds of the requested UI element does not take the screen scale into account.
>>
>> The fix is to adjust the bounds by the screen scale before returning it.
>>
>> You can test it on a Windows machine with scaling set to >= 125% as follows:
>> 1. Turn on Windows Narrator
>> 2. Run any JavaFX program with at least UI controls, for example, `hello.HelloTextField` in `apps/toys/Hello`
>> 3. TAB between the controls
>>
>> Without the fix, Narrator shows the focus indicator in the wrong position and is too small. With the fix, it is correct. While testing this, I discovered an unrelated (and preexisting) bug where the focus indicator for a TextField or TextArea whose content is larger that the control (and is displayed with scroll bars) is not clipped to the visible area. This happens regardless of screen scale. I will file a follow-up bug for this.
>>
>> Note that this bug is specific to Windows. It does not occur on macOS, which works correctly on a retina or non-retina display.
>
> Kevin Rushforth has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix conversion to platform coords
Much of my testing was done with a window straddling two screens. It works as expected in all cases I checked. If a single control spans both screens, the part that is on each screen is correctly highlighted by the Windows Narrator visible focus.
Note that in this mode, the window is considered to be "on" one of the screens, and all scales are relative to that screen (not just for accessibility, this is how HiDPI works on Windows if you are multi-monitor HiDPI aware).
-------------
PR: https://git.openjdk.org/jfx/pull/853
More information about the openjfx-dev
mailing list