[jfx19] RFR: 8291502: Mouse or touch presses on a non-focusable region don't clear the focusVisible flag of the current focus owner [v3]
Kevin Rushforth
kcr at openjdk.org
Mon Aug 1 23:18:55 UTC 2022
On Mon, 1 Aug 2022 18:42:46 GMT, Michael Strauß <mstrauss at openjdk.org> wrote:
>> The `focusVisible` flag is only set on a node when it acquires input focus using a keyboard interaction, and it is cleared by mouse and touch interactions.
>>
>> It is not necessary for a node to lose input focus in order to lose `focusVisible`. Currently, clicking on a region of the scene that does not contain a focusable node does not clear the `focusVisible` flag.
>>
>> Detecting clicks or touches that should clear `focusVisible` can be achieved by adding an event filter for `MOUSE_PRESSED` and `TOUCH_PRESSED` to the `Scene`.
>>
>> There is an additional noteworthy change with this PR:
>> Adding event filters to `Scene` causes many tests to fail due to a bug in `MouseEventFirer` that was identified in [8253769](https://bugs.openjdk.org/browse/JDK-8253769). Previously, mouse events generated by `MouseEventFirer` skipped a code path that causes test failures due to incorrect coordinates. With the added event filters, the code path for mouse events is slightly different, exposing the incorrect coordinates and causing tests to fail.
>> This problem can be solved by making the "alternative" `MouseEvent` generation path the default path.
>>
>> Note: Since this is a follow-up fix for [8268225](https://bugs.openjdk.org/browse/JDK-8268225), I'm targeting this fix for `jfx19`.
>
> Michael Strauß has updated the pull request incrementally with one additional commit since the last revision:
>
> null focus owner never has visible focus
As a possible additional follow-on bug for the original feature, in a future release, is that navigating using the Windows Narrator's focus traversal keys doesn't set `focusVisible`. This is independent of this bug (this PR doesn't change that behavior).
-------------
PR: https://git.openjdk.org/jfx/pull/852
More information about the openjfx-dev
mailing list