Bug 138702 - MouseEvent consumed is ignored by DomainEventDispatcher upon mouseReleased
Summary: MouseEvent consumed is ignored by DomainEventDispatcher upon mouseReleased
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Draw2d (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-26 14:07 EDT by Sandi Schoellhammer CLA
Modified: 2007-03-15 07:43 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 Sandi Schoellhammer CLA 2006-04-26 14:07:34 EDT
Because super.dispatchMouseReleased(me); triggers creation of a new MouseEvent as currentEvent after dispatching the consumed state of the dispatched mouseevent is lost, hence draw2dBusy() will always return false. 

The domain will receive the released event no matter what.  
/**
 * @see EventDispatcher#dispatchMouseReleased(org.eclipse.swt.events.MouseEvent)
 */
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);
	}
}
Comment 1 Steven R. Shaw CLA 2006-04-26 16:32:10 EDT
Can you describe how this problem would realize itself in a real use-case?  i.e. is the problem reproducible in Logic designer example or other?
Comment 2 Sandi Schoellhammer CLA 2006-04-26 16:43:14 EDT
I created a glass layer (working in layeredpane) ala swings GlassPane that grabs all events when its active. It makes sure all events are consumed by the glasspane so it doesnt end up in the domain or figures. I could workaround it, but it seems like a bug in the implementation. The event upon mouse release can't be prevented from reaching the tool while all other events can.