Bug 263992. Fix widget/windows bug revealed by widget caching changes: Resize(x,y,w,h) needs to fix up popups the same way Move() does. r=ere,sr=roc, patch by swalker and roc

This commit is contained in:
roc+%cs.cmu.edu 2004-10-13 20:17:05 +00:00
Родитель 98b1cd3b91
Коммит 407418eef2
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -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;