ImageJ Toolbar Popup Menu not working OpenJDK 11 Windows,MacOSX

I detected a possible Windows, MacOSX bug in ImageJ when working with OpenJDK 11.01 (tested on Windows 10 and MacOSX 10.12).

On Linux Ubuntu 18.10 the popup menu works fine.

When I try to open the popup menu of the ImageJ toolbar (e.g., right-click on the line selection button)
the menu is not shown. I think this could be a possible OpenJDK bug.

Can someone reproduce this bug, too?

One workaround or implementation is to trigger the popup menu in the mouse released action, see:

Can anyone reproduce this?

@Wayne I think this could be a potential OpenJDK problem.

I don’t see this problem with Open JDK 12 on macOS.

Clipboard

Hello @Wayne I tried again on Windows 10 with Java 11.02 and OpenJDK 12-ea+28 to no avail.
The context menu could not be triggered. It would be nice is someone else could confirm my findings on Windows.

I can confirm I see the same with OpenJDK 11.0.2:

  • Can’t get context menu to appear on Windows
  • Works normally on macOS

The latest ImageJ daily build (1.52k62) works around this bug by changing

isRightClick = e.isPopupTrigger()||e.isMetaDown();

in Toolbar.java to

isRightClick = e.isPopupTrigger()||(!IJ.isMacintosh()&&(flags&Event.META_MASK)!=0);

which is the way ImageJ triggers popup menus in image windows. The MouseEvent.isPopupTrigger() method appears to be broken in OpenJDK 11 and OpenJDK 12 on Windows.

2 Likes