Bug 1540305 - Notify content of position change. r=geckoview-reviewers,esawin
authorEitan Isaacson <eitan@monotonous.org>
Tue, 02 Apr 2019 17:15:39 +0000
changeset 467626 9cbe81319d8704833d63598994f716c583556ccd
parent 467625 093c37e856fbcfa76a3ae067fbd99278303b62b9
child 467627 ef359a791d6a5da56734432e5edca6873cdcf2ba
push id35806
push userrgurzau@mozilla.com
push dateWed, 03 Apr 2019 04:07:39 +0000
treeherdermozilla-central@45808ab18609 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgeckoview-reviewers, esawin
bugs1540305
milestone68.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 1540305 - Notify content of position change. r=geckoview-reviewers,esawin Differential Revision: https://phabricator.services.mozilla.com/D25488
widget/android/nsWindow.cpp
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1663,27 +1663,32 @@ void nsWindow::Resize(double aWidth, dou
   Resize(mBounds.x, mBounds.y, aWidth, aHeight, aRepaint);
 }
 
 void nsWindow::Resize(double aX, double aY, double aWidth, double aHeight,
                       bool aRepaint) {
   ALOG("nsWindow[%p]::Resize [%f %f %f %f] (repaint %d)", (void*)this, aX, aY,
        aWidth, aHeight, aRepaint);
 
+  bool needPositionDispatch = aX != mBounds.x || aY != mBounds.y;
   bool needSizeDispatch = aWidth != mBounds.width || aHeight != mBounds.height;
 
   mBounds.x = NSToIntRound(aX);
   mBounds.y = NSToIntRound(aY);
   mBounds.width = NSToIntRound(aWidth);
   mBounds.height = NSToIntRound(aHeight);
 
   if (needSizeDispatch) {
     OnSizeChanged(gfx::IntSize::Truncate(aWidth, aHeight));
   }
 
+  if (needPositionDispatch) {
+    NotifyWindowMoved(mBounds.x, mBounds.y);
+  }
+
   // Should we skip honoring aRepaint here?
   if (aRepaint && FindTopLevel() == nsWindow::TopWindow()) RedrawAll();
 }
 
 void nsWindow::SetZIndex(int32_t aZIndex) {
   ALOG("nsWindow[%p]::SetZIndex %d ignored", (void*)this, aZIndex);
 }