summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2006-03-14 19:42:49 +0000
committerMark Wielaard <mark@klomp.org>2006-03-14 19:42:49 +0000
commitb410bb398821cad89e45b6f7bcc8a78858ae2ea5 (patch)
tree262d1e36a5cab3bdff006f64d4b66b5246f03186
parent25f343f53789312009db619e1530d5267bcf9e96 (diff)
downloadclasspath-b410bb398821cad89e45b6f7bcc8a78858ae2ea5.tar.gz
Fixes bug #26641
* java/awt/LightweightDispatcher.java (dispatchEvent): Return result of handleMouseEvent. (handleMouseEvent): Return boolean to indicate whether we handled the event by passing it to a lightweight.
-rw-r--r--ChangeLog8
-rw-r--r--java/awt/LightweightDispatcher.java12
2 files changed, 15 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 58ef73e2a..086c7d321 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-14 Mark Wielaard <mark@klomp.org>
+
+ Fixes bug #26641
+ * java/awt/LightweightDispatcher.java (dispatchEvent): Return result
+ of handleMouseEvent.
+ (handleMouseEvent): Return boolean to indicate whether we handled the
+ event by passing it to a lightweight.
+
2006-03-14 Wolfgang Baer <WBaer@gmx.de>
* org/omg/PortableInterceptor/ORBInitInfoPackage/ObjectIdHelper.java,
diff --git a/java/awt/LightweightDispatcher.java b/java/awt/LightweightDispatcher.java
index 6573b128e..2f254bccf 100644
--- a/java/awt/LightweightDispatcher.java
+++ b/java/awt/LightweightDispatcher.java
@@ -110,14 +110,12 @@ class LightweightDispatcher
*/
public boolean dispatchEvent(AWTEvent event)
{
- boolean dispatched = false;
if (event instanceof MouseEvent && event.getSource() instanceof Window)
{
MouseEvent mouseEvent = (MouseEvent) event;
- handleMouseEvent(mouseEvent);
- dispatched = true;
+ return handleMouseEvent(mouseEvent);
}
- return dispatched;
+ return false;
}
/**
@@ -125,8 +123,9 @@ class LightweightDispatcher
* (Window instances) and dispatches them to the correct lightweight child.
*
* @param ev the mouse event
+ * @return whether or not we found a lightweight that handled the event.
*/
- private void handleMouseEvent(MouseEvent ev)
+ private boolean handleMouseEvent(MouseEvent ev)
{
Window window = (Window) ev.getSource();
Component target = window.findComponentAt(ev.getX(), ev.getY());
@@ -195,6 +194,9 @@ class LightweightDispatcher
// influenced by this modified event.
ev.setSource(window);
ev.translatePoint(-dx, -dy);
+ return true;
}
+ else
+ return false;
}
}