Bug 1132592 - Avoid showing PluginWidgetParent widgets before they are positioned and clipped. r=aklotz

This commit is contained in:
Jim Mathies
2015-02-13 12:27:56 -06:00
parent a5ac6dd4d1
commit dd9c53e608
2 changed files with 7 additions and 9 deletions

View File

@@ -152,10 +152,6 @@ PluginWidgetParent::RecvCreate(nsresult* aResult)
DebugOnly<nsresult> drv; DebugOnly<nsresult> drv;
drv = mWidget->EnableDragDrop(true); drv = mWidget->EnableDragDrop(true);
NS_ASSERTION(NS_SUCCEEDED(drv), "widget call failure"); NS_ASSERTION(NS_SUCCEEDED(drv), "widget call failure");
drv = mWidget->Show(true);
NS_ASSERTION(NS_SUCCEEDED(drv), "widget call failure");
drv = mWidget->Enable(true);
NS_ASSERTION(NS_SUCCEEDED(drv), "widget call failure");
#if defined(MOZ_WIDGET_GTK) #if defined(MOZ_WIDGET_GTK)
// For setup, initially GTK code expects 'window' to hold the parent. // For setup, initially GTK code expects 'window' to hold the parent.

View File

@@ -217,16 +217,18 @@ CompositorChild::RecvUpdatePluginConfigurations(const nsIntPoint& aContentOffset
bounds.width, bounds.height, false); bounds.width, bounds.height, false);
NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure"); NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
nsTArray<nsIntRect> rectsOut; nsTArray<nsIntRect> rectsOut;
// This call may change the value of isVisible
CalculatePluginClip(bounds, aPlugins[pluginsIdx].clip(), CalculatePluginClip(bounds, aPlugins[pluginsIdx].clip(),
aContentOffset, aParentLayerVisibleRegion, aContentOffset, aParentLayerVisibleRegion,
rectsOut, visibleBounds, isVisible); rectsOut, visibleBounds, isVisible);
if (isVisible) { // content clipping region (widget origin)
// content clipping region (widget origin) rv = widget->SetWindowClipRegion(rectsOut, false);
rv = widget->SetWindowClipRegion(rectsOut, false); NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
}
} }
rv = widget->Enable(isVisible);
NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");
// visible state - updated after clipping, prior to invalidating // visible state - updated after clipping, prior to invalidating
rv = widget->Show(isVisible); rv = widget->Show(isVisible);
NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure"); NS_ASSERTION(NS_SUCCEEDED(rv), "widget call failure");