summaryrefslogtreecommitdiff
path: root/java/awt/LightweightDispatcher.java
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-07-28 19:23:40 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-07-28 19:23:40 +0000
commit2a774db1581985c8937125759b0c053231229676 (patch)
tree1b2ebff337b143d85a3d2fd384f8fad34ec93647 /java/awt/LightweightDispatcher.java
parentadc782a71e90f3fdbb656db13a1bb1806c083c51 (diff)
downloadclasspath-2a774db1581985c8937125759b0c053231229676.tar.gz
2006-07-28 Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge HEAD --> generics-branch for 2006-07-23 to 0.92 branch point.
Diffstat (limited to 'java/awt/LightweightDispatcher.java')
-rw-r--r--java/awt/LightweightDispatcher.java24
1 files changed, 13 insertions, 11 deletions
diff --git a/java/awt/LightweightDispatcher.java b/java/awt/LightweightDispatcher.java
index 05f88dcf6..3ea3f90a6 100644
--- a/java/awt/LightweightDispatcher.java
+++ b/java/awt/LightweightDispatcher.java
@@ -178,24 +178,22 @@ class LightweightDispatcher
new MouseEvent(lastTarget, MouseEvent.MOUSE_EXITED,
ev.getWhen(), ev.getModifiers(), p1.x, p1.y,
ev.getClickCount(), ev.isPopupTrigger());
+ //System.err.println("event: " + mouseExited);
lastTarget.dispatchEvent(mouseExited);
}
- // If a target exists dispatch the MOUSE_ENTERED event only if
- // there is currently no component from which a drag operation
- // started (dragTarget == null) or the target is that component
- // (dragTarget == target)
- // That way a user can click and hold on a button (putting it into
- // the armed state), move the cursor above other buttons without
- // affecting their rollover state and get back to the initial
- // button.
- if (target != null && (dragTarget == null || dragTarget == target))
+ // If a target exists dispatch the MOUSE_ENTERED event.
+ // Experimenting shows that the MOUSE_ENTERED is also dispatched
+ // when the mouse is dragging.
+ if (target != null)
{
Point p = convertPointToChild(window, ev.getPoint(), target);
MouseEvent mouseEntered =
- new MouseEvent(target, MouseEvent.MOUSE_ENTERED, ev.getWhen(),
+ new MouseEvent(target,
+ MouseEvent.MOUSE_ENTERED, ev.getWhen(),
ev.getModifiers(), p.x, p.y, ev.getClickCount(),
ev.isPopupTrigger());
+ //System.err.println("event: " + mouseEntered);
target.dispatchEvent(mouseEntered);
}
}
@@ -222,7 +220,11 @@ class LightweightDispatcher
// it was released.
if (dragTarget != null && dragButton == ev.getButton())
{
- target = dragTarget;
+ // Only post MOUSE_RELEASED to dragTarget (set in
+ // MOUSE_PRESSED) when the dragTarget is actually visible.
+ // Otherwise post the event to the normal target.
+ if (dragTarget.isVisible())
+ target = dragTarget;
dragTarget = null;
}