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

Tooltips in menuItems of a menuButton in a dialog are closed unexpectedly on macOS

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: openjfx18
    • Fix Version/s: tbd
    • Component/s: javafx
    • Labels:

      Description

      A dialog contains a menuButton control that has some menuItems which include tooltips.

      After showing the dialog and clicking the menuButton, its contextMenu is displayed. Moving the mouse over the different menuItems shows and hides their tooltips as expected.

      However, on macOS only, when the dialog has the init owner set to the primary stage (setting initOwner(null) doesn't present the issue), if the mouse is over the menuItems that lay inside the dialog window, the tooltip is displayed and almost immediately closed. For the menuItems that are outside the dialog window, the tooltips are closed as expected.

      The attached test shows the issue, that can be reproduced on macOS (Intel/Apple silicon) only, but with any JavaFX version from 11 to head.

      Image TooltipFails.png shows the issue on "Item 0" or "Item 1", as those are inside the dialog window.

      Image TooltipWorks.png shows it works as expected on "Item 2", "item 3", ... which are outside the dialog window.

      After some inspection, it can be seen that when the mouse is over "Item 0" or "Item 1", the tooltip is displayed, and even if the mouse is still, there is a MouseExit event from the ContextMenu window and a MouseEnter event to the Dialog window. This exit event causes the Tooltip's leftTimer to get started and when it finishes, it closes the tooltip.


        Attachments

        1. TooltipFails.png
          TooltipFails.png
          255 kB
        2. TooltipIssue.java
          1 kB
        3. TooltipWorks.png
          TooltipWorks.png
          304 kB

          Activity

            People

            Assignee:
            jpereda Jose Pereda
            Reporter:
            jpereda Jose Pereda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: