You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/09/03 19:06:10 UTC
svn commit: r811036 -
/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
Author: gbrown
Date: Thu Sep 3 17:06:09 2009
New Revision: 811036
URL: http://svn.apache.org/viewvc?rev=811036&view=rev
Log:
Don't fire mouse click if container mouse down is consumed.
Modified:
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java?rev=811036&r1=811035&r2=811036&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Container.java Thu Sep 3 17:06:09 2009
@@ -121,6 +121,7 @@
private Component mouseOverComponent = null;
+ private boolean mouseDown = false;
private Component mouseDownComponent = null;
private long mouseDownTime = 0;
private int mouseClickCount = 0;
@@ -713,6 +714,8 @@
protected boolean mouseDown(Mouse.Button button, int x, int y) {
boolean consumed = false;
+ mouseDown = true;
+
if (isEnabled()) {
// Notify container listeners
consumed = containerMouseListeners.mouseDown(this, button, x, y);
@@ -782,7 +785,8 @@
}
// Synthesize mouse click event
- if (component != null
+ if (mouseDown
+ && component != null
&& component == mouseDownComponent
&& component.isEnabled()
&& component.isVisible()) {
@@ -792,6 +796,8 @@
}
}
+ mouseDown = false;
+
return consumed;
}