Bug 162090. Mozilla not respecting SPI_GETWORKAREA when opening new window. Patch by danm. r=aaronl, sr=jst

This commit is contained in:
aaronl%netscape.com 2002-12-14 00:36:29 +00:00
Родитель 8f9b903a71
Коммит 9b88b2238c
1 изменённых файлов: 18 добавлений и 0 удалений

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

@ -964,6 +964,24 @@ PRBool nsXULWindow::LoadSizeFromXUL()
}
if (gotSize) {
// constrain to screen size
nsCOMPtr<nsIDOMWindowInternal> domWindow;
GetWindowDOMWindow(getter_AddRefs(domWindow));
if (domWindow) {
nsCOMPtr<nsIDOMScreen> screen;
domWindow->GetScreen(getter_AddRefs(screen));
if (screen) {
PRInt32 screenWidth;
PRInt32 screenHeight;
screen->GetAvailWidth(&screenWidth);
screen->GetAvailHeight(&screenHeight);
if (specWidth > screenWidth)
specWidth = screenWidth;
if (specHeight > screenHeight)
specHeight = screenHeight;
}
}
mIntrinsicallySized = PR_FALSE;
if (specWidth != currWidth || specHeight != currHeight)
SetSize(specWidth, specHeight, PR_FALSE);