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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user