Community
Participate
Working Groups
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.
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); } /**
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?
(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.
Resolving as WONTFIX due to last comment.