From c50a22b86b7bc6cc9640580dc4b89b0c78d84a46 Mon Sep 17 00:00:00 2001 From: "dean_tessman%hotmail.com" Date: Tue, 8 Oct 2002 05:01:10 +0000 Subject: [PATCH] bug 73970 - Tooltips disappear when at bottom of screen Actually just fixes tooltips so they don't flip to the left of the mouse pointer when they extend off the right edge of the screen. r=me, sr=bryner@netscape.com patch by zipo13@myrealbox.com --- layout/xul/base/src/nsMenuPopupFrame.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/layout/xul/base/src/nsMenuPopupFrame.cpp b/layout/xul/base/src/nsMenuPopupFrame.cpp index 54a6abe1444..4dcf503efd4 100644 --- a/layout/xul/base/src/nsMenuPopupFrame.cpp +++ b/layout/xul/base/src/nsMenuPopupFrame.cpp @@ -1238,12 +1238,12 @@ nsMenuPopupFrame::SyncViewWithFrame(nsIPresContext* aPresContext, // ensure it is not even partially offscreen. if ( (screenViewLocX + mRect.width) > screenRightTwips ) { - // as a result of moving the popup, it might end up under the mouse. This - // would be bad as the subsequent mouse_up would trigger whatever - // unsuspecting item happens to be at that position. To get around this, make - // move it so the right edge is where the mouse is, as we're guaranteed - // that the mouse is on the screen! - xpos -= mRect.width; + if (tag == nsXULAtoms::tooltip) { + //the tooltip is off the screen to the right - shift it to the left as much as needed + xpos -= (screenViewLocX + mRect.width) - screenRightTwips; + } + else + xpos -= mRect.width; } if ( (screenViewLocY + mRect.height) > screenBottomTwips ) ypos -= (mRect.height + margin.top + margin.bottom);