JDK-8318032 : SceneChangeShouldNotFocusStageTest robot test throws exceptions
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: jfx20
  • Priority: P3
  • Status: New
  • Resolution: Unresolved
  • OS: generic
  • Submitted: 2023-10-12
  • Updated: 2023-10-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Description
The SceneChangeShouldNotFocusStageTest robot test generates exceptions on the Mac even after the issue reported in JDK-8305675 is fixed. With a few modifications it can generate the same exceptions on Windows 11 where JDK-8305675 does not apply. I've attached a stripped down version which reproduces this bug on both systems.

The test is contrived but it is a standard Robot test and it seems to have some fragile timing components so I've kept a high priority. The underlying problem seems to be executing scene changes during the initial platform window animation so it might be enough to add a delay before beginning the test.

The exception call stack isn't very useful but can be found in JDK-8305675.


Comments
(When will I learn not to Clone issues? Clone never does what I expect.) For convenience I'm copying the notes I wrote up in JDK-8305675. When the scene is installed in the stage the system tries to resize the window to match. This can trigger a timing pulse which causes the Timeline to install the next scene in the middle of setting up the first one. The re-entered routine is SceneModel.invalidated() in the file java/javafx/stage/Window.java. The result is that the bookkeeping gets permanently messed up and those exceptions keep getting triggered. In some way I do not fully understand this is caused by an interaction with the animation that occurs when the Mac window iconifies into the dock. If the TimeLine is tweaked to push the scene changes out past that animation period the exceptions go away. The bug can be induced on Windows 11 by removing the setIconified(true) call and tweaking the Timeline to speed things up. On Windows 11 the window starts out at some random size and then animates to a new size when the first scene is set. Again, there seems to be an interaction between the Timeline and the timing of that animation.
12-10-2023

Blocked on Mac, not Windows.
12-10-2023