From b2ed0ffb1ff2b8df2630a464f5dd354f3023f830 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Wed, 28 Mar 2001 04:33:08 +0000 Subject: [PATCH] to work around a bug in OSX, check first if we're already at the location we're trying to move a popup to and if so, don't call MoveWindow. r=danm/sr=sfraser. bug#58226. git-svn-id: svn://10.0.0.236/trunk@90624 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacWindow.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mozilla/widget/src/mac/nsMacWindow.cpp b/mozilla/widget/src/mac/nsMacWindow.cpp index 2a4eaa1e958..fd74d70bcc9 100644 --- a/mozilla/widget/src/mac/nsMacWindow.cpp +++ b/mozilla/widget/src/mac/nsMacWindow.cpp @@ -701,11 +701,18 @@ NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY) localRect.width = 100; localRect.height = 100; - if(mOffsetParent != nsnull) { + if ( mOffsetParent ) { mOffsetParent->WidgetToScreen(localRect,globalRect); aX=globalRect.x; aY=globalRect.y; - ::MoveWindow(mWindowPtr, aX, aY, false); + + // there is a bug on OSX where if we call ::MoveWindow() with the same + // coordinates as it's current location, it will go to (0,0,-1,-1). The + // fix is to not move the window if we're already there. (radar# 2669004) + Rect currBounds; + ::GetWindowBounds ( mWindowPtr, kWindowGlobalPortRgn, &currBounds ); + if ( currBounds.left != aX || currBounds.top != aY ) + ::MoveWindow(mWindowPtr, aX, aY, false); } return NS_OK;