Bug 574778 - Disable intrinsic sizing for chrome documents when enabling fullscreen mode. r=smaug.

This commit is contained in:
Jim Mathies 2010-07-19 16:47:41 -05:00
parent f741260b17
commit 20178f3b8a

View File

@ -175,6 +175,7 @@
#include "nsNetUtil.h"
#include "nsFocusManager.h"
#include "nsIJSON.h"
#include "nsIXULWindow.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
#include "nsIDOMXULControlElement.h"
@ -3943,6 +3944,15 @@ nsGlobalWindow::SetFullScreen(PRBool aFullScreen)
return NS_OK;
}
// Prevent chrome documents which are still loading from resizing
// the window after we set fullscreen mode.
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin;
GetTreeOwner(getter_AddRefs(treeOwnerAsWin));
nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwnerAsWin));
if (aFullScreen && xulWin) {
xulWin->SetIntrinsicallySized(PR_FALSE);
}
nsCOMPtr<nsIWidget> widget = GetMainWidget();
if (widget)
widget->MakeFullScreen(aFullScreen);