Backed out changeset 64fa36b13e1a (bug 1473816) a=backout
authorXidorn Quan <me@upsuper.org>
Sat, 03 Nov 2018 16:20:15 +1100
changeset 501036 e406bf1c8cd43ef04156d142cf5225d31c884f4e
parent 501035 42154e18f97c55e00950460b695406574bf0cf4c
child 501037 10cf5976e46f3fd3a0895873b6f73bf08ce7acef
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1473816
milestone64.0
backs out64fa36b13e1a9d9b9c7da4b4d991b4c7570ce215
Backed out changeset 64fa36b13e1a (bug 1473816) a=backout
widget/nsBaseWidget.cpp
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -815,51 +815,42 @@ nsBaseWidget::PerformFullscreenTransitio
 // Put the window into full-screen mode
 //
 //-------------------------------------------------------------------------
 void
 nsBaseWidget::InfallibleMakeFullScreen(bool aFullScreen, nsIScreen* aScreen)
 {
   HideWindowChrome(aFullScreen);
 
-  nsCOMPtr<nsIScreen> screen = aScreen;
-  if (!screen) {
-    screen = GetWidgetScreen();
-    if (!screen) {
-      return;
-    }
-  }
-
   if (aFullScreen) {
     if (!mOriginalBounds) {
       mOriginalBounds = new LayoutDeviceIntRect();
     }
     *mOriginalBounds = GetScreenBounds();
 
     // Move to top-left corner of screen and size to the screen dimensions
-    int32_t left, top, width, height;
-    if (NS_SUCCEEDED(screen->GetRectDisplayPix(&left, &top, &width, &height))) {
-      Resize(left, top, width, height, true);
+    nsCOMPtr<nsIScreen> screen = aScreen;
+    if (!screen) {
+      screen = GetWidgetScreen();
+    }
+    if (screen) {
+      int32_t left, top, width, height;
+      if (NS_SUCCEEDED(screen->GetRectDisplayPix(&left, &top, &width, &height))) {
+        Resize(left, top, width, height, true);
+      }
     }
   } else if (mOriginalBounds) {
-    int32_t left, top, width, height;
-    if (NS_FAILED(screen->GetAvailRectDisplayPix(&left, &top,
-                                                 &width, &height))) {
-      return;
-    }
-    gfx::Rect screenRect(left, top, width, height);
-    gfx::Rect rect;
     if (BoundsUseDesktopPixels()) {
       DesktopRect deskRect = *mOriginalBounds / GetDesktopToDeviceScale();
-      rect = deskRect.ToUnknownRect();
+      Resize(deskRect.X(), deskRect.Y(),
+	     deskRect.Width(), deskRect.Height(), true);
     } else {
-      rect = gfx::Rect(mOriginalBounds->ToUnknownRect());
+      Resize(mOriginalBounds->X(), mOriginalBounds->Y(),
+	     mOriginalBounds->Width(), mOriginalBounds->Height(), true);
     }
-    rect = rect.MoveInsideAndClamp(screenRect);
-    Resize(rect.x, rect.y, rect.width, rect.height, true);
   }
 }
 
 nsresult
 nsBaseWidget::MakeFullScreen(bool aFullScreen, nsIScreen* aScreen)
 {
   InfallibleMakeFullScreen(aFullScreen, aScreen);
   return NS_OK;