diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 72359bd0d2aa..04aa5949f14b 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -771,6 +771,13 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) if (ae->Type() == AndroidGeckoEvent::FORCED_RESIZE || nw != gAndroidBounds.width || nh != gAndroidBounds.height) { + if (sCompositorParent != 0 && gAndroidBounds.width == 0) { + // Propagate size change to compositor. This is sometimes essential + // on startup, because the window size may not have been available + // when the compositor was created. + ScheduleResumeComposition(nw, nh); + } + gAndroidBounds.width = nw; gAndroidBounds.height = nh; @@ -2242,8 +2249,14 @@ void nsWindow::SetCompositor(mozilla::layers::CompositorParent* aCompositorParent, mozilla::layers::CompositorChild* aCompositorChild) { + bool sizeChangeNeeded = (aCompositorParent && !sCompositorParent && gAndroidBounds.width != 0); + sCompositorParent = aCompositorParent; sCompositorChild = aCompositorChild; + + if (sizeChangeNeeded) { + ScheduleResumeComposition(gAndroidBounds.width, gAndroidBounds.height); + } } void