Bug 1126479 - Correctly set widget size mode on Android r=jchen
☠☠ backed out by bec2a9eac2d9 ☠ ☠
authorJames Willcox <snorp@snorp.net>
Thu, 10 Aug 2017 11:39:42 -0500
changeset 374796 6798fd30a785cb02358adc83227c11b6490effde
parent 374795 094e6802c2f440f74076374030268de13a806b22
child 374797 4fb119706335b308f049949e5641565b035e4f80
push id93765
push userjwillcox@mozilla.com
push dateTue, 15 Aug 2017 14:30:19 +0000
treeherdermozilla-inbound@4fb119706335 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1126479
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1126479 - Correctly set widget size mode on Android r=jchen MozReview-Commit-ID: AfNWDsyQC95
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1776,16 +1776,22 @@ void
 nsWindow::SetZIndex(int32_t aZIndex)
 {
     ALOG("nsWindow[%p]::SetZIndex %d ignored", (void*)this, aZIndex);
 }
 
 void
 nsWindow::SetSizeMode(nsSizeMode aMode)
 {
+    if (aMode == mSizeMode) {
+        return;
+    }
+
+    nsBaseWidget::SetSizeMode(aMode);
+
     switch (aMode) {
         case nsSizeMode_Minimized:
             GeckoAppShell::MoveTaskToBack();
             break;
         case nsSizeMode_Fullscreen:
             MakeFullScreen(true);
             break;
         default:
@@ -1925,16 +1931,18 @@ nsWindow::MakeFullScreen(bool aFullScree
     }
 
     mIsFullScreen = aFullScreen;
     mAndroidView->mEventDispatcher->Dispatch(aFullScreen ?
             u"GeckoView:FullScreenEnter" : u"GeckoView:FullScreenExit");
 
     nsIWidgetListener* listener = GetWidgetListener();
     if (listener) {
+        mSizeMode = mIsFullScreen ? nsSizeMode_Fullscreen : nsSizeMode_Normal;
+        listener->SizeModeChanged(mSizeMode);
         listener->FullscreenChanged(mIsFullScreen);
     }
     return NS_OK;
 }
 
 mozilla::layers::LayerManager*
 nsWindow::GetLayerManager(PLayerTransactionChild*, LayersBackend, LayerManagerPersistence)
 {