Bug 596451 part G - Fix a condition where FixupWindow is called too early and doesn't know that we are a windowless plugin yet. Call FixupWindow from nsPluginInstanceOwner::CreateWidget, r=roc
authorBenjamin Smedberg <benjamin@smedbergs.us>
Wed, 27 Oct 2010 09:10:50 -0400
changeset 57215 900cdb9c89529e731edabd78f853a3458ff6d13c
parent 57214 eda1909e1416781c4ab9576180179d3b8c4e732c
child 57216 c6a351a89dde8ee22010da6be19da3f9177bdb01
push id16846
push userbsmedberg@mozilla.com
push dateWed, 10 Nov 2010 15:29:47 +0000
treeherdermozilla-central@bdbef533364f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs596451
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 596451 part G - Fix a condition where FixupWindow is called too early and doesn't know that we are a windowless plugin yet. Call FixupWindow from nsPluginInstanceOwner::CreateWidget, r=roc
layout/generic/nsObjectFrame.cpp
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -6177,16 +6177,19 @@ NS_IMETHODIMP nsPluginInstanceOwner::Cre
             ws_info->display = DefaultXDisplay();
           }
 
           nsCAutoString description;
           GetPluginDescription(description);
           NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10.");
           mFlash10Quirks = StringBeginsWith(description, flash10Head);
 #endif
+
+          // Changing to windowless mode changes the NPWindow geometry.
+          mObjectFrame->FixupWindow(mObjectFrame->GetContentRect().Size());
         } else if (mWidget) {
           nsIWidget* parent = mWidget->GetParent();
           NS_ASSERTION(parent, "Plugin windows must not be toplevel");
           // Set the plugin window to have an empty cliprect. The cliprect
           // will be reset when nsRootPresContext::UpdatePluginGeometry
           // runs later. The plugin window does need to have the correct
           // size here.
           nsAutoTArray<nsIWidget::Configuration,1> configuration;