Bug 138702

Summary: MouseEvent consumed is ignored by DomainEventDispatcher upon mouseReleased
Product: [Tools] GEF Reporter: Sandi Schoellhammer <sandi.schoellhammer>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: Matthias.Teschner, sandi.schoellhammer
Version: 3.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.