From 595fd1a7000e5ead0726e87b4d6213a89adec535 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 2 Mar 2014 21:52:02 +0100 Subject: [PATCH] * Linux - Fixed that the battlefield popup menu also works when running on a linux system. --- .../java/mage/client/game/PlayAreaPanel.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java index 8bc124da47..1edb57ca6e 100644 --- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java +++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java @@ -203,9 +203,20 @@ public class PlayAreaPanel extends javax.swing.JPanel { } }); + battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent Me) { + this.checkMenu(Me); + } + + // neccessary for linux and mac systems + @Override + public void mousePressed(MouseEvent Me) { + this.checkMenu(Me); + } + + private void checkMenu(MouseEvent Me){ if (Me.isPopupTrigger() && playingMode) { popupMenu.show(Me.getComponent(), Me.getX(), Me.getY()); } @@ -233,6 +244,15 @@ public class PlayAreaPanel extends javax.swing.JPanel { battlefieldPanel.getMainPanel().addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent Me) { + this.checkMenu(Me); + } + // neccessary for linux and mac systems + @Override + public void mousePressed(MouseEvent Me) { + this.checkMenu(Me); + } + + private void checkMenu(MouseEvent Me){ if (Me.isPopupTrigger() && playingMode) { popupMenu.show(Me.getComponent(), Me.getX(), Me.getY()); }