Open mipastgt opened 3 years ago
I can confirm the problem.
JPro uses Monocle to generate the MouseEvents. It seems like Monocle doesn't support isPopupTrigger and always returns false.
But JPro creates ContextMenuEvent
, which can be accessed by the method setOnContextMenuRequested
After changing my code accordingly it works now. Nevertheless this is not really nice because it makes the distinction between context menu handling and other mouse activities more difficult. I don't know much about Monocle but do you think this is a bug in it that should be filed or would you consider this as normal behaviour?
I would say it's a bug in Monocle. Someone marked the field "isPopupTrigger" with "ToDo", so someone planned to finish it. People using Monocle for UnitTests should encounter the same issue.
I've created a ticket for JavaFX: https://bugs.openjdk.java.net/browse/JDK-8265633
Currently JPro has special code to generate the ContextMenu, which would no longer be necessary after fixing this issue.
Whatever I do I can't get context menus to work. I have an application which normally displays a context menu when I click on a route point which I want to edit but when running with JPro no context menu is shown.
I have configured the
index.html
file to use JavaFX context menus like this:What else can I do to get my context menus shown? To show the context menu I use a mouse handler like this:
The problem seems to be that
e.isPopupTrigger()
always returns false because I always get the outputon the console.
I am running locally on a Mac with the following config: