Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8348744

Application window not always activated on macOS 15

XMLWordPrintable

        On macOS 15 Sequoia, JavaFX applications are not activated, and thus do not receive focus, when launched from a terminal that does not have focus. This includes the case of a JavaFX application launched from an agent such as that used to run automated headful tests in Jenkins. This causes several test failures in our automated Jenkins headful test job.

        This can be reproduced in one of two ways:

        I. Using a standalone application

        1. Run the following from a Terminal shell
            sleep 5; java HelloRectangle

        2. Quickly (before the 5 second sleep finishes) click on the desktop then click on it again to remove focus from (deactivate) the Terminal; alternatively, click on the Finder or some other application (not another terminal window)

        BUG: The application will not be activated and the Stage will not have focus


        II. Using a headful system test

        1. Run the following from a Terminal shell
            sleep 5; gradle -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests CanvasTest

        2. Quickly (before the 5 second sleep finishes) click on the desktop then click on it again to remove focus from (deactivate) the Terminal; alternatively, click on the Finder or some other application (not another terminal window)

        BUG: the test will FAIL with a timeout assertion because the Stage is not focused

        CanvasTest > testCanvasRect() FAILED
            org.opentest4j.AssertionFailedError: Timeout when waiting for focus change ==> expected: <true> but was: <false>
                at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
                at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
                at app//org.junit.jupiter.api.AssertTrue.failNotTrue(AssertTrue.java:63)
                at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:36)
                at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:214)
                at app//test.javafx.scene.web.CanvasTest.testCanvasRect(CanvasTest.java:124)

              kcr Kevin Rushforth
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: