Bug 1259492 - Ensure window position is constrained to the screen after it has been sized properly in nsXULWindow::OnChromeLoaded. r=emk

This commit is contained in:
Jonathan Kew 2016-03-24 17:08:19 +00:00
Родитель 8da73c781f
Коммит dfa53d5003
1 изменённых файлов: 9 добавлений и 5 удалений

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

@ -1080,16 +1080,20 @@ void nsXULWindow::OnChromeLoaded()
int32_t width = 0, height = 0;
if (NS_SUCCEEDED(cv->GetContentSize(&width, &height))) {
treeOwner->SizeShellTo(docShellAsItem, width, height);
// Now that we know the window's final size, we can re-do its
// positioning so that it is properly constrained to the screen.
if (positionSet) {
LoadPositionFromXUL(width, height);
}
// Update specified size for the final LoadPositionFromXUL call.
specWidth = width;
specHeight = height;
}
}
}
}
// Now that we have set the window's final size, we can re-do its
// positioning so that it is properly constrained to the screen.
if (positionSet) {
LoadPositionFromXUL(specWidth, specHeight);
}
LoadMiscPersistentAttributesFromXUL();
if (mCenterAfterLoad && !positionSet) {