JDK-8180737 : [macos] Context Menus don't work in Swing on OS X
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u121
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: os_x
  • CPU: x86_64
  • Submitted: 2017-05-20
  • Updated: 2017-06-13
  • Resolved: 2017-06-13
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
macOS Sierra version 10.12.4

EXTRA RELEVANT SYSTEM CONFIGURATION :
MacBook Pro Retina

A DESCRIPTION OF THE PROBLEM :
Starting with 1.8.0_121 context menus in NetBeans stopped working when using the right-click gestures on the touchpad. The main gesture is two-finger-tap + click. The contextmenu opens and immediately closes again. Here's a video illustrating the problem:

https://www.youtube.com/watch?v=Swm-1AHRtBs&feature=youtu.be

As you can see in the video, right after the click, there's a scroll event. Sometimes it's horizontal, sometimes vertical. I made the projects window smaller, so it's easier to see the scrolling.

I tried u_121 and u_131. Both versions have this issue, while u_112 works fine. I've verified that this problem also affects others, as I've been asked by a couple of users at a recent conference how to solve this problem. This issue actually made me look like an idiot during my presentation ;-).

I assume it's a general Swing problem related to this bug fix:
https://bugs.openjdk.java.net/browse/JDK-8166591

REGRESSION.  Last worked in version 8u112

ADDITIONAL REGRESSION INFORMATION: 
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Install NetBeans 8.2 and run on OS X MacBook Prop Retina (don't know if it only affects retina). Go to Projects Menu and right-click one of the projects.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The context menu should open and stay open.
ACTUAL -
The context menu opens and shuts down immediately. Also if scrollbars are visible, the view scrolls a tiny bit.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Use a mouse (which is very uncomfortable for anyone used to work without a mouse)


Comments
not able to reproduce using default System Preferences. If any custom System Preferences are made to reproduce this scenario, that should be mentioned along with a test case.
13-06-2017

Checked this on MAC OS X 10.12.4 (Non-Retina display) with NetBeans 8.2 and JDK 8u112, 8u121, ad 8u131 and couldn't reproduce the issue. The youtube video rom description illustrate the reported issue: https://www.youtube.com/watch?v=Swm-1AHRtBs&feature=youtu.be This still need to be checked for Retina display as mentioned in the report.
12-06-2017