JDK-8188308 : Two finger click on a trackpad to show a popup is broken (popup hides almost immediately).
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8u144
  • Priority: P3
  • Status: Closed
  • Resolution: Incomplete
  • OS: os_x
  • CPU: x86
  • Submitted: 2017-09-29
  • Updated: 2017-10-06
  • Resolved: 2017-10-03
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
1.8.0_144-b01

ADDITIONAL OS VERSION INFORMATION :
16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

A DESCRIPTION OF THE PROBLEM :
Two-finger click (a right click) on a mac touch pad will show a popup menu, but then the menu is almost immediately closed.  From debugging, this because a mouse scroll event reaches the component that was clicked on and BasicPopupMenuUI.MouseGragger calls cancelPopupMenu on any mouse_wheel event that is outside the popup.  

The mouse wheel event comes in when you wiggle or lift you fingers after clicking.   This is almost impossible not to do.

I found a matching report in bug 8180737 which was marked as cannot reproduce, but it is reproducible.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See http://bugs.java.com/bugdatabase/view_bug.do?bug_id=8180737 a linked video of the problem.  

Any swing JPopupMenu (netbeans works as a testcase).  Two-finger click on  anything in the project window and see the popup hide as soon as you lift your fingers.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Popup stays open.
ACTUAL -
Popup closes 90% of the time.

REPRODUCIBILITY :
This bug can be reproduced often.


Comments
JDK 8u144 MAC OS X 10.12.6 (Sierra) NetBeans 8.2 Two-finger click (a right click) on a mac touch pad will show a popup menu, but then the menu is almost immediately closed. Checked this with above configuration using PopupMenu example from tutorial (see below) and couldn't completely reproduce/run this in NetBeans 8.2. https://docs.oracle.com/javase/tutorial/uiswing/examples/components/PopupMenuDemoProject/src/components/PopupMenuDemo.java nd couldn However, from the description it seems to be related to https://bugs.openjdk.java.net/browse/JDK-8173876 which is fixed in JDK 8u152. Writing back to the submitter requesting status with JDK 8u152 ea build(http://jdk.java.net/8/)
03-10-2017