Bug 592563. When a plugin is completely invisible, hide its NSView. r=roc

--HG--
extra : rebase_source : 1ca8ca2e91f57a1eaf0f97e1e4eba7927f8a3b32
This commit is contained in:
Steven Michaud 2010-09-06 14:56:11 +12:00
parent 44dc338657
commit 3a324d63c7
2 changed files with 16 additions and 9 deletions

View File

@ -402,6 +402,8 @@ public:
nsCocoaTextInputHandler* TextInputHandler() { return &mTextInputHandler; }
NSView<mozView>* GetEditorView();
PRBool IsPluginView() { return (mWindowType == eWindowType_plugin); }
protected:
PRBool ReportDestroyEvent();

View File

@ -907,8 +907,8 @@ NS_IMETHODIMP nsChildView::Show(PRBool aState)
[mView setHidden:!aState];
mVisible = aState;
if (!mVisible)
HideChildPluginViews(mView);
if (!mVisible && IsPluginView())
HidePlugin();
}
return NS_OK;
@ -1660,18 +1660,23 @@ void nsChildView::ApplyConfiguration(nsIWidget* aExpectedParent,
nsWindowType kidType;
aConfiguration.mChild->GetWindowType(kidType);
#endif
NS_ASSERTION(kidType == eWindowType_plugin || kidType == eWindowType_child,
"Configured widget is not a child or plugin type");
NS_ASSERTION(kidType == eWindowType_plugin,
"Configured widget is not a plugin type");
NS_ASSERTION(aConfiguration.mChild->GetParent() == aExpectedParent,
"Configured widget is not a child of the right widget");
aConfiguration.mChild->Resize(
// nsIWidget::Show() doesn't get called on plugin widgets unless we call
// it from here. See bug 592563.
nsChildView* child = static_cast<nsChildView*>(aConfiguration.mChild);
child->Show(!aConfiguration.mClipRegion.IsEmpty());
child->Resize(
aConfiguration.mBounds.x, aConfiguration.mBounds.y,
aConfiguration.mBounds.width, aConfiguration.mBounds.height,
aRepaint);
// On Mac we don't use the clip region here, we just store it
// in case GetPluginClipRect needs it.
static_cast<nsChildView*>(aConfiguration.mChild)->
StoreWindowClipRegion(aConfiguration.mClipRegion);
// Store the clip region here in case GetPluginClipRect needs it.
child->StoreWindowClipRegion(aConfiguration.mClipRegion);
}
nsresult nsChildView::ConfigureChildren(const nsTArray<Configuration>& aConfigurations)