Bug 195165

Summary: [Tool] Tools receive multiple handleButtonUp() calls when doing a quick drag and release.
Product: [Tools] GEF Reporter: Tom Crockett <Thomas.M.Crockett>
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
The first (buggy) event generated during a mouse move.
none
The second (correct) event generated by an swt mouseup. none

Description Tom Crockett CLA 2007-07-02 14:01:06 EDT
If I do a slow drag and release on my GEF canvas, the tool receives only one call to handleButtonUp(), generated from the Eclipse mouse-up event. If however I drag and release quickly, the tool receives 2 calls to handleButtonUp(), the first being generated during a mouse move, and the second by the mouse up. Attached are two stacktraces showing how each gets generated. The first event is generated from what looks like a hacky section of code in AbstractTool.mouseMove(...), to wit:

if (!isInputSynched(me)) {
boolean b1 = getCurrentInput().isMouseButtonDown(1);
		boolean b2 = getCurrentInput().isMouseButtonDown(2);
		boolean b3 = getCurrentInput().isMouseButtonDown(3);
		boolean b4 = getCurrentInput().isMouseButtonDown(4);
		boolean b5 = getCurrentInput().isMouseButtonDown(5);
		getCurrentInput().verifyMouseButtons = true;
		getCurrentInput().setInput(me);
		if (b1) handleButtonUp(1);
		if (b2) handleButtonUp(2);
		if (b3) handleButtonUp(3);
		if (b4) handleButtonUp(4);
		if (b5) handleButtonUp(5);
		...
Comment 1 Tom Crockett CLA 2007-07-02 14:02:15 EDT
Created attachment 72884 [details]
The first (buggy) event generated during a mouse move.
Comment 2 Tom Crockett CLA 2007-07-02 14:03:01 EDT
Created attachment 72885 [details]
The second (correct) event generated by an swt mouseup.
Comment 3 Tom Crockett CLA 2007-07-02 14:04:39 EDT
By the way, is there a good reason why we can't vote on GEF bugs?