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

PopupWindow does not disappear when associated Control is not visible.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 8
    • javafx
    • None


      A Popup/PopupWindow is associated with a Node with show(node,x,y).
      It also can be associated with a Window, show(window)

      What should happen when that node is no longer present on the screen? In the attached sample program, the Scene is changed out when the button is clicked, making the associated Node no longer visible on the Screen, and yet the Popup stays visible.

      There is code in quantum (GlassScreen) that can have issues with an NPE in a related circumstance (RT-27455).
          @Override public void sceneChanged() {
              if (glassStage instanceof PopupStage) {
                  ((PopupStage)glassStage).getOwnerScene().sceneChanged();
              }
      The NPE is because getOwnderScene() becomes NULL - showing an issue, because we should either track the Window not the Scene - or take down the PopupWindow when the OwnerScene becomes null.

      But what is the correct behavior here? I would think that when the Node is destroyed or has a visibility change, the popup would too. If associated with a Window, then it would be tied to the Window.
      And where do we want to handle this behavior - Quantum and/or Controls ?

        1. ChangeScenePopup.java
          4 kB
          David Hill
        2. HelloApopup.java
          2 kB
          Parvathi Somashekar
        3. RT-28454.patch
          2 kB
          Parvathi Somashekar
        4. RT-28454.patch
          2 kB
          Parvathi Somashekar

            ckyang Chien Yang (Inactive)
            ddhill David Hill (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: