Permalink
Browse files

Fixed bogus popup menu opening when scrolling with two-fingers on a

trackpad.
  • Loading branch information...
1 parent 1531d53 commit e3a8b501c88afe6d251f91e27a5f15fe295ef5f1 @kayahr committed Mar 30, 2012
Showing with 13 additions and 1 deletion.
  1. +5 −1 src/changes/changes.xml
  2. +8 −0 src/main/java/de/ailis/xadrian/utils/SwingUtils.java
View
@@ -7,7 +7,11 @@
<author email="k@ailis.de">Klaus Reimer</author>
</properties>
<body>
- <release version="1.4.3" date="2012-03-25" description="Minor update">
+ <release version="1.4.3" date="2012-03-30" description="Minor update">
+ <action dev="k" type="fix" date="2012-03-30">
+ Fixed bogus popup menu opening when scrolling with two-fingers on
+ a trackpad.
+ </action>
<action dev="k" type="add" date="2012-03-25">
Implemented export to template code and import from template code.
</action>
@@ -93,6 +93,10 @@ public static void setPopupMenu(final JComponent component,
@Override
public void mousePressed(final MouseEvent e)
{
+ // Ignore mouse buttons outside of the normal range. This
+ // fixes problems with trackpad scrolling.
+ if (e.getButton() > MouseEvent.BUTTON3) return;
+
if (e.isPopupTrigger())
{
popup.show(component, e.getX(), e.getY());
@@ -102,6 +106,10 @@ public void mousePressed(final MouseEvent e)
@Override
public void mouseReleased(final MouseEvent e)
{
+ // Ignore mouse buttons outside of the normal range. This
+ // fixes problems with trackpad scrolling.
+ if (e.getButton() > MouseEvent.BUTTON3) return;
+
if (e.isPopupTrigger())
{
popup.show(component, e.getX(), e.getY());

0 comments on commit e3a8b50

Please sign in to comment.