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

[macos] Stage set to iconified before being shown is displayed on screen

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • jfx22
    • jfx11, jfx20, 8u152, 9
    • javafx
    • None
    • macOS 13.2 Ventura

    Description

      To reproduce this, run the attached test program on macOS 12 (Monterey) or macOS 13 (Ventura)

      $ java StartIconified

      EXPECTED: The window is initially iconfied and not displayed
      ACTUAL: The window is displayed on the screen, and is not iconified

      As noted in JDK-8298500, we need automated tests to verify that we can initially show a window that is iconified, maximized, or fullscreen.

      The following unit test accidentally tests iconified, and is also failing as a result of this bug.

      $ gradle --info -PFULL_TEST=true -PUSE_ROBOT=true :systemTests:test --tests SceneChangeShouldNotFocusStageTest

      SceneChangeShouldNotFocusStageTest > windowShouldRemainIconified() STANDARD_ERROR
          Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "javafx.scene.Scene.preferredSize()" because "scene" is null
           at javafx.graphics@21-internal/javafx.scene.Scene$2.preferredSize(Scene.java:411)
           at javafx.graphics@21-internal/com.sun.javafx.scene.SceneHelper.preferredSize(SceneHelper.java:65)
           at javafx.graphics@21-internal/javafx.stage.Window$SceneModel.invalidated(Window.java:867)
           at javafx.base@21-internal/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
           at javafx.base@21-internal/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
           at javafx.graphics@21-internal/javafx.stage.Window.setScene(Window.java:823)
           at javafx.graphics@21-internal/javafx.stage.Stage.setScene(Stage.java:270)
           at test.robot.javafx.scene.SceneChangeShouldNotFocusStageTest$TestApp.lambda$start$0(SceneChangeShouldNotFocusStageTest.java:77)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(TimelineClipCore.java:239)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.TimelineClipCore.playTo(TimelineClipCore.java:180)
           at javafx.graphics@21-internal/javafx.animation.Timeline.doPlayTo(Timeline.java:172)
           at javafx.graphics@21-internal/javafx.animation.AnimationAccessorImpl.playTo(AnimationAccessorImpl.java:39)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.InfiniteClipEnvelope.timePulse(InfiniteClipEnvelope.java:120)
           at javafx.graphics@21-internal/javafx.animation.Animation.doTimePulse(Animation.java:1189)
           at javafx.graphics@21-internal/javafx.animation.Animation$1.lambda$timePulse$0(Animation.java:207)
           at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
           at javafx.graphics@21-internal/javafx.animation.Animation$1.timePulse(Animation.java:206)
           at javafx.graphics@21-internal/com.sun.scenario.animation.AbstractPrimaryTimer.timePulseImpl(AbstractPrimaryTimer.java:343)
           at javafx.graphics@21-internal/com.sun.scenario.animation.AbstractPrimaryTimer$MainLoop.run(AbstractPrimaryTimer.java:266)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:588)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.PaintCollector.liveRepaintRenderJob(PaintCollector.java:327)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:889)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler$ViewEventNotification.run(GlassViewEventHandler.java:849)
           at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleViewEvent$15(GlassViewEventHandler.java:931)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleViewEvent(GlassViewEventHandler.java:930)
           at javafx.graphics@21-internal/com.sun.glass.ui.View.handleViewEvent(View.java:535)
           at javafx.graphics@21-internal/com.sun.glass.ui.View.notifyResize(View.java:875)
           at javafx.graphics@21-internal/com.sun.glass.ui.mac.MacView.notifyResize(MacView.java:113)
           at javafx.graphics@21-internal/com.sun.glass.ui.mac.MacWindow._setBounds2(Native Method)
           at javafx.graphics@21-internal/com.sun.glass.ui.mac.MacWindow._setBounds(MacWindow.java:70)
           at javafx.graphics@21-internal/com.sun.glass.ui.Window.setBounds(Window.java:589)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.WindowStage.setBounds(WindowStage.java:319)
           at javafx.graphics@21-internal/javafx.stage.Window$TKBoundsConfigurator.apply(Window.java:1619)
           at javafx.graphics@21-internal/javafx.stage.Window.applyBounds(Window.java:1477)
           at javafx.graphics@21-internal/javafx.stage.Window.adjustSize(Window.java:333)
           at javafx.graphics@21-internal/javafx.stage.Window$SceneModel.invalidated(Window.java:868)
           at javafx.base@21-internal/javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:112)
           at javafx.base@21-internal/javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
           at javafx.graphics@21-internal/javafx.stage.Window.setScene(Window.java:823)
           at javafx.graphics@21-internal/javafx.stage.Stage.setScene(Stage.java:270)
           at test.robot.javafx.scene.SceneChangeShouldNotFocusStageTest$TestApp.lambda$start$0(SceneChangeShouldNotFocusStageTest.java:77)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(TimelineClipCore.java:239)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.TimelineClipCore.playTo(TimelineClipCore.java:180)
           at javafx.graphics@21-internal/javafx.animation.Timeline.doPlayTo(Timeline.java:172)
           at javafx.graphics@21-internal/javafx.animation.AnimationAccessorImpl.playTo(AnimationAccessorImpl.java:39)
           at javafx.graphics@21-internal/com.sun.scenario.animation.shared.InfiniteClipEnvelope.timePulse(InfiniteClipEnvelope.java:120)
           at javafx.graphics@21-internal/javafx.animation.Animation.doTimePulse(Animation.java:1189)
           at javafx.graphics@21-internal/javafx.animation.Animation$1.lambda$timePulse$0(Animation.java:207)
           at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
           at javafx.graphics@21-internal/javafx.animation.Animation$1.timePulse(Animation.java:206)
           at javafx.graphics@21-internal/com.sun.scenario.animation.AbstractPrimaryTimer.timePulseImpl(AbstractPrimaryTimer.java:343)
           at javafx.graphics@21-internal/com.sun.scenario.animation.AbstractPrimaryTimer$MainLoop.run(AbstractPrimaryTimer.java:266)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:588)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:572)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:565)
           at javafx.graphics@21-internal/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:352)
           at javafx.graphics@21-internal/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

      SceneChangeShouldNotFocusStageTest > windowShouldRemainIconified() FAILED
          org.opentest4j.AssertionFailedError: Stage should be iconified ==> expected: <true> but was: <false>
              at app//org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
              at app//org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:40)
              at app//org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:210)
              at app//test.robot.javafx.scene.SceneChangeShouldNotFocusStageTest.windowShouldRemainIconified(SceneChangeShouldNotFocusStageTest.java:55)


      This is a product bug, not a test bug.

      Attachments

        Issue Links

          Activity

            People

              mfox Martin Fox
              kcr Kevin Rushforth
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: