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

[macos] Calling stage.setY(0) twice causes wrong popups location

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • jfx18
    • jfx11, 8, jfx16
    • javafx
    • None
    • x86_64
    • os_x

    Description

      On macOS, the task bar prevents placing a window on top of it.

      Therefore, if an app tries stage.setY(0) once, its window will be moved down below the task bar, setting the correct value: stage.getY() = 23.

      However, calling stage.setY(0) once again (or any number of times for that matter), the app will be still rendered with origin at y = 23, but now stage.getY() will return 0.

      This has some side effects. For instance, if there are popup controls, these will be misplaced, moved up 23 pixels precisely.

      The attached test shows this case for a Menu: After clicking twice the button, the menu is shown on top of the MenuBar (see pic).

      Also the test includes an stage.yProperty listener, that shows after the first click:

      Stage.y at 0.0, was at 157.0
      Stage.y at 23.0, was at 0.0

      (which confirms that the stage is moved down 23 pixels).

      And after the second click:

      Stage.y at 0.0, was at 23.0
       
      (which confirms that at this point the stage y coordinate doesn't match the visible location).

      This test fails for any JavaFX version from 11 to latest 17-ea.

      Attachments

        Issue Links

          Activity

            People

              jpereda Jose Pereda
              jpereda Jose Pereda
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: