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

[macos] Stage with ownership disappears when moved to another screen

XMLWordPrintable

    • Cause Known
    • generic
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      MacOS 10.15.5

      A DESCRIPTION OF THE PROBLEM :
      - My application opens a dialog / a popup (a new Stage) with ownership set (on the primaryStage for instance)
      - I move the new dialog to another screen: it disappears (the main stage is still visible)

      The "popup" stage title is still visible in the toolbar (with the main dialog), but even clicking on it doesn't bring it back. If I move the primary stage to this other screen, then the "popup" reappears again. It's possible to make them both visible (on different screens) after a few manipulations but it's kinda odd.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Have at least 2 screens. Start the example application (or just create an app that opens a new Stage with ownership), click on the button to open the popup, move the popup to another screen.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The new stage still visible on the other screen
      ACTUAL -
      The new stage is hidden on the other screen just after moving

      ---------- BEGIN SOURCE ----------
      class TestApp : Application() {
      override fun start(primaryStage: Stage) {
      primaryStage.scene = Scene(HBox().apply {
      val btn = Button("click me")
      children.add(btn)
      btn.onAction = EventHandler {
      val popup = Stage(StageStyle.DECORATED)
      popup.initOwner(primaryStage)
      popup.scene = Scene(Label("popup"), 200.0, 200.0)
      popup.show()
      }
      }, 400.0, 400.0)
      primaryStage.show()
      }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Move back the main window to the other screen

      FREQUENCY : always


        1. step1.png
          step1.png
          773 kB
        2. step2.png
          step2.png
          1.58 MB
        3. step3.png
          step3.png
          2.32 MB
        4. step4.png
          step4.png
          257 kB

            kcr Kevin Rushforth
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: