Bug 1370605 - Don't wait for a resize before entering fullscreen on Android r=esawin
There may not be a resize event coming, and we don't do anything special
with the transition anyway.
MozReview-Commit-ID: 1toNPdMHA1B
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1455,17 +1455,16 @@ nsWindow::DumpWindows(const nsTArray<nsW
DumpWindows(w->mChildren, indent+1);
}
}
nsWindow::nsWindow() :
mScreenId(0), // Use 0 (primary screen) as the default value.
mIsVisible(false),
mParent(nullptr),
- mAwaitingFullScreen(false),
mIsFullScreen(false)
{
}
nsWindow::~nsWindow()
{
gTopLevelWindows.RemoveElement(this);
ALOG("nsWindow %p destructor", (void*)this);
@@ -1759,22 +1758,16 @@ nsWindow::Resize(double aX,
if (needSizeDispatch) {
OnSizeChanged(gfx::IntSize::Truncate(aWidth, aHeight));
}
// Should we skip honoring aRepaint here?
if (aRepaint && FindTopLevel() == nsWindow::TopWindow())
RedrawAll();
-
- nsIWidgetListener* listener = GetWidgetListener();
- if (mAwaitingFullScreen && listener) {
- listener->FullscreenChanged(mIsFullScreen);
- mAwaitingFullScreen = false;
- }
}
void
nsWindow::SetZIndex(int32_t aZIndex)
{
ALOG("nsWindow[%p]::SetZIndex %d ignored", (void*)this, aZIndex);
}
@@ -1920,19 +1913,23 @@ nsWindow::DispatchEvent(WidgetGUIEvent*
nsresult
nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen*)
{
if (!mAndroidView) {
return NS_ERROR_NOT_AVAILABLE;
}
mIsFullScreen = aFullScreen;
- mAwaitingFullScreen = true;
mAndroidView->mEventDispatcher->Dispatch(aFullScreen ?
u"GeckoView:FullScreenEnter" : u"GeckoView:FullScreenExit");
+
+ nsIWidgetListener* listener = GetWidgetListener();
+ if (listener) {
+ listener->FullscreenChanged(mIsFullScreen);
+ }
return NS_OK;
}
mozilla::layers::LayerManager*
nsWindow::GetLayerManager(PLayerTransactionChild*, LayersBackend, LayerManagerPersistence)
{
if (mLayerManager) {
return mLayerManager;
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -335,17 +335,16 @@ protected:
nsTArray<nsWindow*> mChildren;
nsWindow* mParent;
double mStartDist;
double mLastDist;
nsCOMPtr<nsIIdleServiceInternal> mIdleService;
- bool mAwaitingFullScreen;
bool mIsFullScreen;
bool UseExternalCompositingSurface() const override {
return true;
}
static void DumpWindows();
static void DumpWindows(const nsTArray<nsWindow*>& wins, int indent = 0);