Bug 1243413 - If a plugin window is hidden in an adjacent scroll frame due to APZ scroll state changes, make sure to show the plugin window after the scroll operation complete. r=kats

This commit is contained in:
Jim Mathies 2016-02-04 09:10:55 -06:00
Родитель 21900562cd
Коммит 1839261e94
2 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -664,6 +664,7 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
, mLastPluginUpdateLayerTreeId(0)
, mPluginUpdateResponsePending(false)
, mDeferPluginWindows(false)
, mPluginWindowsHidden(false)
#endif
{
MOZ_ASSERT(NS_IsMainThread());
@ -2210,6 +2211,14 @@ CompositorParent::UpdatePluginWindowState(uint64_t aId)
return false;
}
// If the plugin windows were hidden but now are not, we need to force
// update the metrics to make sure they are visible again.
if (mPluginWindowsHidden) {
PLUGINS_LOG("[%" PRIu64 "] re-showing", aId);
mPluginWindowsHidden = false;
pluginMetricsChanged = true;
}
if (!lts.mPluginData.Length()) {
// We will pass through here in cases where the previous shadow layer
// tree contained visible plugins and the new tree does not. All we need
@ -2300,6 +2309,7 @@ CompositorParent::HideAllPluginWindows()
}
mDeferPluginWindows = true;
mPluginUpdateResponsePending = true;
mPluginWindowsHidden = true;
Unused << SendHideAllPlugins((uintptr_t)GetWidget());
ScheduleComposition();
}

Просмотреть файл

@ -529,6 +529,9 @@ protected:
// indicates if plugin window visibility and metric updates are currently
// being defered due to a scroll operation.
bool mDeferPluginWindows;
// indicates if the plugin windows were hidden, and need to be made
// visible again even if their geometry has not changed.
bool mPluginWindowsHidden;
#endif
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);