diff options
author | David Jee <djee@redhat.com> | 2004-01-21 14:39:15 +0000 |
---|---|---|
committer | David Jee <djee@gcc.gnu.org> | 2004-01-21 14:39:15 +0000 |
commit | 3f07b288984a59621d6b7a9d9db129284eac158d (patch) | |
tree | d5beb43f88b238b26ab71ff023152db35d910eaf /libjava | |
parent | 2a2001bed591f3e9062e769bfbb2a0e33859118d (diff) | |
download | gcc-3f07b288984a59621d6b7a9d9db129284eac158d.zip gcc-3f07b288984a59621d6b7a9d9db129284eac158d.tar.gz gcc-3f07b288984a59621d6b7a9d9db129284eac158d.tar.bz2 |
2004-01-21 David Jee <djee@redhat.com>
* java/awt/Container.java
(LightweightDispatcher.handleEvent): Add an extra check to avoid
dispatching MOUSE_ENTERED event twice. Translate the point for
the mouse event target before dispatching the event.
From-SVN: r76278
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 7 | ||||
-rw-r--r-- | libjava/java/awt/Container.java | 12 |
2 files changed, 18 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 889e520..97c75ef 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,10 @@ +2004-01-21 David Jee <djee@redhat.com> + + * java/awt/Container.java + (LightweightDispatcher.handleEvent): Add an extra check to avoid + dispatching MOUSE_ENTERED event twice. Translate the point for + the mouse event target before dispatching the event. + 2004-01-20 Jakub Jelinek <jakub@redhat.com> * Makefile.am (lib_org_w3c_dom_la_LIBADD, diff --git a/libjava/java/awt/Container.java b/libjava/java/awt/Container.java index caf1134..5d176be 100644 --- a/libjava/java/awt/Container.java +++ b/libjava/java/awt/Container.java @@ -1633,8 +1633,18 @@ class LightweightDispatcher implements Serializable MouseEvent me = (MouseEvent) e; acquireComponentForMouseEvent (me); - if (mouseEventTarget != null) + // Avoid dispatching an ENTERED event twice + if (mouseEventTarget != null + && e.getID() != MouseEvent.MOUSE_ENTERED) { + // Calculate point translation for the event target. + // We use absolute location on screen rather than relative + // location because the event target might be a nested child. + Point parentLocation = nativeContainer.getLocationOnScreen(); + Point childLocation = mouseEventTarget.getLocationOnScreen(); + me.translatePoint(parentLocation.x - childLocation.x, + parentLocation.y - childLocation.y); + Component oldSource = (Component) me.getSource (); me.setSource (mouseEventTarget); mouseEventTarget.dispatchEvent (me); |