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

PopupWindow does not disappear when associated Control is not visible.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 9
    • Component/s: javafx
    • Labels:
      None

      Description


      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 ?

        Attachments

        1. ChangeScenePopup.java
          4 kB
        2. HelloApopup.java
          2 kB
        3. RT-28454.patch
          2 kB
        4. RT-28454.patch
          2 kB

          Issue Links

            Activity

              People

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

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Imported: