revert because it was committed to the wrong branch
This commit is contained in:
parent
84f054a3ff
commit
bfd2a354e0
1 changed files with 2 additions and 15 deletions
|
|
@ -48,8 +48,6 @@ public class GroundContainer extends WtBaseframe implements WtDropTarget,
|
|||
private final StendhalClient client;
|
||||
|
||||
private boolean windowWasActiveOnMousePressed = true;
|
||||
private int xOnMousePressed;
|
||||
private int yOnMousePressed;
|
||||
|
||||
/**
|
||||
* The UI.
|
||||
|
|
@ -104,27 +102,16 @@ public class GroundContainer extends WtBaseframe implements WtDropTarget,
|
|||
@Override
|
||||
public synchronized void mousePressed(MouseEvent e) {
|
||||
windowWasActiveOnMousePressed = (KeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow() != null);
|
||||
xOnMousePressed = e.getX();
|
||||
yOnMousePressed = e.getY();
|
||||
super.mousePressed(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles mouse click events
|
||||
*
|
||||
* @param p point of click
|
||||
*
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public synchronized boolean onMouseClick(final Point p) {
|
||||
|
||||
// on MS Windows releasing the mouse after a drag&drop action is
|
||||
// counted as mouse click: https://sourceforge.net/support/tracker.php?aid=2976895
|
||||
if ((Math.abs(p.getX() - xOnMousePressed) > 10)
|
||||
|| (Math.abs(p.getY() - yOnMousePressed) > 10)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// base class checks if the click is within a child
|
||||
if (super.onMouseClick(p)) {
|
||||
// yes, click already processed
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue