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

This commit is contained in:
Jonathan Kew 2016-03-24 17:08:19 +00:00
parent b0055baf3c
commit 1d47c6c64b

View File

@ -1080,14 +1080,18 @@ 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
// 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(width, height);
}
}
}
}
LoadPositionFromXUL(specWidth, specHeight);
}
LoadMiscPersistentAttributesFromXUL();