Bug 242909 - SWTEventDispatcher#dispatchMouseReleased() resets the event
Summary: SWTEventDispatcher#dispatchMouseReleased() resets the event
Status: RESOLVED WONTFIX
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-01 15:11 EDT by Pratik Shah CLA
Modified: 2014-08-19 13:26 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Shah CLA 2008-08-01 15:11:57 EDT
SWTEventDispatcher#dispatchMouseReleased() calls receive(me) after it has dispatched the event.  This resets the event and then DomainEventDispatcher processes it as well, even if it was consumed by the Draw2d handler.
Comment 1 Pratik Shah CLA 2008-08-01 15:13:14 EDT
Patch:

Index: src/org/eclipse/draw2d/SWTEventDispatcher.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/SWTEventDispatcher.java,v
retrieving revision 1.25
diff -u -r1.25 SWTEventDispatcher.java
--- src/org/eclipse/draw2d/SWTEventDispatcher.java	18 May 2007 20:39:32 -0000	1.25
+++ src/org/eclipse/draw2d/SWTEventDispatcher.java	1 Aug 2008 19:12:34 -0000
@@ -239,7 +239,6 @@
 		mouseTarget.handleMouseReleased(currentEvent);
 	}
 	releaseCapture();
-	receive(me);
 }
 
 /**
Comment 2 Randy Hudson CLA 2008-08-04 12:25:07 EDT
Removing receive() would mean that the mouse cursor wouldn't be refreshed.

So, if the figure under the mouse changed (and if it changed to a figure with no cursor, then the tool's cursor should be used), then the cursor update wouldn't happen until another mouse event happened.

Maybe DomainEventDispatcher could be smarted in overriding dispatchMouseReleased().  What's the problem you're encountering?  The tool is getting a MouseUp event it doesn't want?
Comment 3 Pratik Shah CLA 2008-08-04 13:24:50 EDT
(In reply to comment #2)
> Removing receive() would mean that the mouse cursor wouldn't be refreshed.
> 
> So, if the figure under the mouse changed (and if it changed to a figure with
> no cursor, then the tool's cursor should be used), then the cursor update
> wouldn't happen until another mouse event happened.

Aah, that's why it's there.

> 
> Maybe DomainEventDispatcher could be smarted in overriding
> dispatchMouseReleased().  What's the problem you're encountering?  The tool is
> getting a MouseUp event it doesn't want?

Right.  It's not a problem for me, but I ran into it because of another bug in our code (mouse-down wasn't being consumed), and so mouseUp was causing selection to change even though it was consumed.  I just didn't know why the event was being cleared out in dispatchMouseReleased().  I am fine with closing this as won't fix.

Comment 4 Alexander Nyßen CLA 2014-08-19 13:26:59 EDT
Resolving as WONTFIX due to last comment.