Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8176799

[macosx] Spurious MouseWheelEvents generated by jdk8u121 for Mac

XMLWordPrintable

    • x86
    • os_x

      FULL PRODUCT VERSION :
      java version "1.8.0_121"
      Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      MacOSX 10.9.5
      Darwin rolfs1tcbookpro.lan 13.4.0 Darwin Kernel Version 13.4.0: Mon Jan 11 18:17:34 PST 2016; root:xnu-2422.115.15~1/RELEASE_X86_64 x86_64

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Retina MacBook Pro

      A DESCRIPTION OF THE PROBLEM :
      After scrolling with the trackpad (two finger drag), additional spurious MouseWheelEvents are generated whenever the track pad is used, specifically they seem to occur when you touch track pad with two fingers and then release.

      REGRESSION. Last worked in version 8u112

      ADDITIONAL REGRESSION INFORMATION:
      Oracle Corporation Java(TM) SE Runtime Environment 1.8.0_112-b16
      Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 25.112-b16
      /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre
      Mac OS X 10.9.5 x86_64


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run the test program below. Use the scroll wheel to scroll the list up and down (in my case, by touching track pad with two fingers and dragging up and down). Then, right click in the list (by touching track pad with two fingers and clicking the track pad). A popup menu appears, but disappears again immediately as soon as you release the track pad. Additionally, touching the track pad with two fingers (not clicking) and releasing again does another mouse wheel move in the original direction.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The popup menu should stay up, and touching and releasing the trackpad without dragging shouldn't scroll.
      ACTUAL -
      See steps to reproduce

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.event.*;
      import javax.swing.*;

      public class ScrollBug
      {
      public static void main(String[] args)
      {
      System.out.println(System.getProperty("java.vendor")+" "+System.getProperty("java.runtime.name")+" "+System.getProperty("java.runtime.version"));
      System.out.println(System.getProperty("java.vm.vendor")+" "+System.getProperty("java.vm.name")+" "+System.getProperty("java.vm.version"));
      System.out.println(System.getProperty("java.home"));
      System.out.println(System.getProperty("os.name")+" "+System.getProperty("os.version")+" "+System.getProperty("os.arch"));
      JFrame frame = new JFrame("Scroll Bug");
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      String[] values = new String[1000];
      for (int i=0; i<values.length; ++i)
      values[i] = "This is value "+i;
      final JList<String> list = new JList<String>(values);
      list.addMouseListener(new MouseAdapter() {
      public void mousePressed(MouseEvent ev)
      {
      if (ev.isPopupTrigger())
      {
      JPopupMenu menu = new JPopupMenu();
      menu.add(new JMenuItem("Blah"));
      menu.show(list, ev.getX(), ev.getY());
      }
      }
      });
      JScrollPane sp = new JScrollPane(list);
      frame.getContentPane().add(sp);
      frame.pack();
      frame.setLocation(100,100);
      frame.setVisible(true);
      }
      }

      ---------- END SOURCE ----------

      SUPPORT :
      YES

            scfitch Stephen Fitch
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: