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.
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.