- assigned_to: nobody --> hobbs
OriginalBugID: 4408 Bug
Version: 8.2.3
SubmitDate: '2000-03-20'
LastModified: '2000-03-30'
Severity: MED
Status: UnAssn
Submitter: techsupp
ChangedBy: hobbs
OS: Linux-Red Hat
Name:
Mark Smith
ReproducibleScript:
Have a look at the following code in CanvasBindProc() in generic/tkCanvas.c:
} else {
/*
* Button release: first process the event, with the button
* still considered to be down. Then repick the current
* item under the assumption that the button is no longer down.
*/
canvasPtr->state = eventPtr->xbutton.state;
CanvasDoEvent(canvasPtr, eventPtr);
eventPtr->xbutton.state ^= mask;
canvasPtr->state = eventPtr->xbutton.state;
PickCurrentItem(canvasPtr, eventPtr);
eventPtr->xbutton.state ^= mask;
}
The problem is that CanvasDoEvent might not return until the mouse has been moved
by the user. This can happen, for example, if the programmer creates a canvas item that
simulates a button with a popup dialog to fire upon ButtonRelease. When the popup dialog
is done, the user has moved the mouse far from where the original ButtonRelease event says
that it is. This can cause undesirable effects, such as the display of a ToolTip on the wrong
canvas item.
DesiredBehavior:
The position of the mouse should be checked again after the CanvasDoEvent() is done.
You can't assume it's still valid.