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

Michael Strauß mstrauss at openjdk.org
Mon Dec 5 16:21:07 UTC 2022


On Mon, 5 Dec 2022 08:19:59 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> 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 ?

A `Scene` is an implementation detail of a JavaFX application, and not something that users of an application will find meaningful. Since we don't attempt to change the window stacking order when the scene graph is changed, we also shouldn't attempt to do so when a `Scene` is changed.

In any case, Windows doesn't allow applications to force a window to the foreground, so that wouldn't work anyway. If a non-foreground process tries to set the foreground window, the call to `SetForegroundWindow` will fail, and the taskbar icon will flash instead.

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

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


More information about the openjfx-dev mailing list