Commit 57685177 authored by Edgar Chen's avatar Edgar Chen
Browse files

Bug 1823284 - Avoid waiting for window resizing if it is already at expected dimensions; r=smaug

Depends on D175384

Differential Revision: https://phabricator.services.mozilla.com/D175213
parent 9e4fd6e6
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -2946,7 +2946,22 @@ void AppWindow::FullscreenWillChange(bool aInFullscreen) {
    }
  }
  MOZ_ASSERT(mFullscreenChangeState == FullscreenChangeState::NotChanging);
  mFullscreenChangeState = FullscreenChangeState::WillChange;

  int32_t winWidth = 0;
  int32_t winHeight = 0;
  GetSize(&winWidth, &winHeight);

  int32_t screenWidth = 0;
  int32_t screenHeight = 0;
  GetAvailScreenSize(&screenWidth, &screenHeight);

  // Check if the window is already at the expected dimensions. If it is, set
  // the fullscreen change state to WidgetResized to avoid waiting for a resize
  // event.
  mFullscreenChangeState =
      (aInFullscreen == (winWidth == screenWidth && winHeight == screenHeight))
          ? FullscreenChangeState::WidgetResized
          : FullscreenChangeState::WillChange;
}

void AppWindow::FullscreenChanged(bool aInFullscreen) {