Skip to content

Commit

Permalink
Fixed bogus popup menu opening when scrolling with two-fingers on a
Browse files Browse the repository at this point in the history
trackpad.
  • Loading branch information
kayahr committed Mar 30, 2012
1 parent 1531d53 commit e3a8b50
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/changes/changes.xml
Expand Up @@ -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>
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/de/ailis/xadrian/utils/SwingUtils.java
Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit e3a8b50

Please sign in to comment.