Bug 1583575 - Remove resize when creating GeckoView window. r=geckoview-reviewers,snorp

The other widget backends do not call resize during nsWindow creation and
there's not really a need to do it. The bounds can just be adjusted at the
beginning.

Differential Revision: https://phabricator.services.mozilla.com/D62613

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Brendan Dahl 2020-02-14 16:53:18 +00:00
parent 588ab9dda4
commit f4176c2f7b

View File

@ -1525,7 +1525,17 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
}
}
mBounds = aRect;
// A default size of 1x1 confuses MobileViewportManager, so
// use 0x0 instead. This is also a little more fitting since
// we don't yet have a surface yet (and therefore a valid size)
// and 0x0 is usually recognized as invalid.
LayoutDeviceIntRect rect = aRect;
if (aRect.width == 1 && aRect.height == 1) {
rect.width = 0;
rect.height = 0;
}
mBounds = rect;
BaseCreate(nullptr, aInitData);
@ -1540,12 +1550,6 @@ nsresult nsWindow::Create(nsIWidget* aParent, nsNativeWidget aNativeParent,
mParent = parent;
}
// A default size of 1x1 confuses MobileViewportManager, so
// use 0x0 instead. This is also a little more fitting since
// we don't yet have a surface yet (and therefore a valid size)
// and 0x0 is usually recognized as invalid.
Resize(0, 0, false);
CreateLayerManager();
#ifdef DEBUG_ANDROID_WIDGET