diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index dbd158425c6..2a40dc98ef1 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -2127,6 +2127,22 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig ResizeTranslucentWindow(aWidth, aHeight); #endif + // When resizing a borderless top-level window the window + // must be placed relative to its parent. WIN32 wants to + // place it relative to the screen, so we used the cached parent + // to calculate the parent's location then add the x,y passed to + // the resize to get the screen coordinate for the borderless top-level + // window. + if (mWindowType == eWindowType_popup) { + HWND parent = mBorderlessParent; + if (parent) { + RECT pr; + VERIFY(::GetWindowRect(parent, &pr)); + aX += pr.left; + aY += pr.top; + } + } + // Set cached value for lightweight and printing mBounds.x = aX; mBounds.y = aY;