On Wed, 9 Nov 2022 00:53:19 GMT, Thiago Milczarek Sayao <tsa...@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. > I agree that changing from one scene to another should not cause a new > request focus call. My only concern is to ensure that this will not cause any > regressions for the initial setting of a scene. A safer change might be to > qualify the existing call to `requestFocus` with a check of the previous > scene, and only call it if `oldScene == null`. > > /reviewers 2 The reason I found this is that `requestFocus()` in glass native side was being called before the window was visible. I'm not sure about windows or macos, but requesting focus on a unmapped window doesn't work (on Linux) and it seems logical to me. Considering that the usual scenario is to `setScene()` and then `show()`. ------------- PR: https://git.openjdk.org/jfx/pull/940