requestFocus on setScene - is it right?

John Hendrikx john.hendrikx at gmail.com
Mon Nov 7 08:42:43 UTC 2022


On 07/11/2022 00:32, Thiago Milczarek Sayão wrote:
> While working on native linux glass code I observed that 
> requestFocus() is called before show().
> If the window is not shown (mapped on Xorg), It can't be focused.
Have you observed this to be a problem? I believe the actual focus 
acquisition is delayed.
>
> The code is on WindowStage.setScene() line 276.
>
> It might be the case when switching the scene, but should the window 
> be focused in that case?
>
> If the user is "focused" on another window and the program decides to 
> switch the scene the window would pop and steal the focus.

Most window managers won't allow this, even if an application does 
request focus.  Instead they'll indicate this in the task bar that a 
window wants the focus.

Is this actually happening?

--John



More information about the openjfx-dev mailing list