Bug 924456 - Ensure that MozAfterPaint events are not fired before the window is completely visible. r=mconley

Differential Revision: https://phabricator.services.mozilla.com/D10957
This commit is contained in:
Michael Kaply
2020-04-21 20:27:13 +00:00
parent f7c2fe93e1
commit c1b1870d6a

View File

@@ -971,7 +971,12 @@ NS_IMETHODIMP AppWindow::SetVisibility(bool aVisibility) {
// mWindow to null and posibly destroy the nsIWidget while its Show method
// is on the stack. We need to keep it alive until Show finishes.
nsCOMPtr<nsIWidget> window = mWindow;
window->Show(aVisibility);
{
// Ensure that MozAfterPaint events are not fired before the window is
// completely visible.
nsAutoScriptBlocker scriptBlocker;
window->Show(aVisibility);
}
nsCOMPtr<nsIWindowMediator> windowMediator(
do_GetService(NS_WINDOWMEDIATOR_CONTRACTID));