RFR: 8296621: Stage steals focus on scene change [v2]

Ambarish Rapte arapte at openjdk.org
Mon Dec 5 08:22:10 UTC 2022


On Sun, 13 Nov 2022 01:02:36 GMT, Thiago Milczarek Sayao <tsayao at openjdk.org> wrote:

>> Simple fix to not requestFocus() on scene change.
>> 
>> The attached bug sample shows that the TextField focused on the scene remains focused when the scene comes back.
>
> Thiago Milczarek Sayao has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add test

The current behavior is different on all three platforms:
Behavior when running the test program attached to JBS.

1. Windows
- Without fix: The Stage does NOT steal focus when scene changes and is NOT brought to foreground. but, the stage icon in task bar flashes with Orange color.
- With this fix: The Stage does NOT steal the focus and is NOT be brought to foreground. but the icon flashing does not occur. It looks like a behavior change.

2. Mac
- Without fix: The Stage does NOT steal the focus but is brought to foreground.
- With this fix: The Stage does NOT steal the focus and is NOT be brought to foreground.

3. Ubuntu
- Without fix: The Stage steals the focus and is brought to foreground.
- With this fix: The Stage does NOT steal the focus and is NOT be brought to foreground.

After the fix, the behavior looks similar on all platform, but this way the user does not get any notification of the Scene change in Application's content. i.e. the behavior change on Windows(icon not flashing) and Mac(not bringing Stage to foreground) seem little undesirable change to me.

Should we consider to atleast bring the Stage to foreground without stealing focus ? or any alternatives ?

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

PR: https://git.openjdk.org/jfx/pull/940


More information about the openjfx-dev mailing list