RFR: 8351357: Add canary system test checking if Stage receives focus on show [v5]

Lukasz Kostyra lkostyra at openjdk.org
Thu Jul 3 12:36:44 UTC 2025


On Wed, 2 Jul 2025 22:45:16 GMT, Martin Fox <mfox at openjdk.org> wrote:

> I'm having an issue with this test. I can't get it to fail on my Windows 11 box but I can get other tests to fail due to focus issues.

I started to see this problem as well while working on [JDK-8359899 (the Stage.isFocused discrepancy)](https://bugs.openjdk.org/browse/JDK-8359899). I have a suspicion that switching to VisualTestBase caused some sort of difference - VisualTestBase creates new Stages separately and doesn't take into account the primary Stage that you would get via overriding Application.start(). I noticed your test does not use VisualTestBase so it might be it.

I have not looked into a solution yet outside of the obvious - reverting to not using VisualTestBase. I will get that figured out very soon with Andy's review suggestions.

> I also notice that even when my test case fails the window is still on top, it just doesn't have focus. So the color testing in this PR seems unnecessary (?) Are you seeing cases where the stage is below other windows when it shows up?

I did have situations where the Stage would appear under currently active window, sometimes even under the terminal window that runs the test.

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

PR Comment: https://git.openjdk.org/jfx/pull/1804#issuecomment-3032101631


More information about the openjfx-dev mailing list