Bug 183292 - Consuming a mouse release event in a figure's MouseListener has no effect
Summary: Consuming a mouse release event in a figure's MouseListener has no effect
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-19 17:52 EDT by Tom Crockett CLA
Modified: 2011-03-10 13:01 EST (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 Tom Crockett CLA 2007-04-19 17:52:49 EDT
SWTEventDispatcher.dispatchMouseReleased() looks like this:

public void dispatchMouseReleased(org.eclipse.swt.events.MouseEvent me) {
	receive(me);
	if (mouseTarget != null) {
		mouseTarget.handleMouseReleased(currentEvent);
	}
	releaseCapture();
	receive(me);
}

Because of that call to releaseCapture(), it doesn't matter if you call consume() on the event inside handleMouseReleased. In the GEF subclass, DomainEventDispatcher, it looks like this:

public void dispatchMouseReleased(org.eclipse.swt.events.MouseEvent me) {
	if (!editorCaptured) {
>		super.dispatchMouseReleased(me);
>		if (draw2dBusy())
>			return;
	}
	if (okToDispatch()) {
		setRouteEventsToEditor(false);
		domain.mouseUp(me, viewer);
		updateFigureUnderCursor(me);
	}
}

draw2dBusy() never returns true after a mouse release, so the method will always continue and get propagated to the GraphicalEditor. If I have a figure on top of the graphical editor which is supposed to intercept all events, I don't want that to happen.
Comment 1 Eclipse Webmaster CLA 2007-07-29 09:22:26 EDT
Changing OS from Mac OS to Mac OS X as per bug 185991
Comment 2 Alexander Nyßen CLA 2011-03-10 12:51:49 EST
Bug #242909 seems to be closely related to this. I think it will make sense to investigate both together.