Closed Bug 59917 Opened 24 years ago Closed 24 years ago

Tooltip should go away when mouse moves

Categories

(Core :: XUL, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: mikepinkerton, Assigned: mikepinkerton)

References

Details

(Keywords: polish)

Per 45522, tooltip should go away when mouse moves.
Status: NEW → ASSIGNED
Keywords: polish
Target Milestone: --- → mozilla1.0
Blocks: 45522
Target Milestone: mozilla1.0 → mozilla0.9
Ok Blake. I found a way around the problem with the extra mouseMove events. This also fixes the problem where tooltips would re-appear after auto-hiding (doh!). New patch attached. Need r=. Index: mozilla/rdf/content/src/nsXULPopupListener.cpp =================================================================== RCS file: /m/pub/mozilla/rdf/content/src/nsXULPopupListener.cpp,v retrieving revision 1.72 diff -u -2 -r1.72 nsXULPopupListener.cpp --- nsXULPopupListener.cpp 2000/11/12 22:09:13 1.72 +++ nsXULPopupListener.cpp 2000/11/13 00:40:01 @@ -446,17 +446,25 @@ // stash the coordinates of the event so that we can still get back to it from within the - // timer scallback. Also stash the node that started this so we can put it into the - // document later on (if the timer ever fires). - mouseEvent->GetClientX(&mMouseClientX); - mouseEvent->GetClientY(&mMouseClientY); + // timer scallback. On win32, we'll get a MouseMove event even when a popup goes away -- + // even when the mouse doesn't change position! To get around this, we make sure the + // mouse has really moved before proceeding. + PRInt32 newMouseX, newMouseY; + mouseEvent->GetClientX(&newMouseX); + mouseEvent->GetClientY(&newMouseY); + if ( mMouseClientX == newMouseX && mMouseClientY == newMouseY ) + return NS_OK; + mMouseClientX = newMouseX; mMouseClientY = newMouseY; - //XXX recognize when a popup is already up and immediately show the - //XXX tooltip for the new item if the dom element is different than - //XXX the element for which we are currently displaying the tip. - //XXX - //XXX for now, just be stupid to get things working. - if (mPopupContent || mTooltipTimer) + // We want to close the tip if it is being displayed and the mouse moves. Recall + // that |mPopupContent| is set when the popup is showing. Furthermore, as the mouse + // moves, we want to make sure we reset the timer to show it, so that the delay + // is from when the mouse stops moving, not when it enters the element. + if ( mPopupContent ) { + ClosePopup(); return NS_OK; - + } + if ( mTooltipTimer ) + mTooltipTimer->Cancel(); + mTooltipTimer = do_CreateInstance("@mozilla.org/timer;1"); if ( mTooltipTimer ) {
Priority: P3 → P2
really cc'ing blake.
Cool, looks good. Might wanna add an XXX to remind yourself to move this hack later if mousemove is ever fixed. And I'm not sure what a `scallback' is ;), but r=blake
remove the hack, that is
sr=sfraser
fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.