mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 863889. nsWindow::Move should compare the same type of pixels when determining if we are moving the window at all. r=jfkthame
This commit is contained in:
parent
bfcf81990d
commit
ef9ea7f803
@ -1299,6 +1299,13 @@ NS_METHOD nsWindow::Move(double aX, double aY)
|
||||
mWindowType == eWindowType_dialog) {
|
||||
SetSizeMode(nsSizeMode_Normal);
|
||||
}
|
||||
|
||||
// for top-level windows only, convert coordinates from global display pixels
|
||||
// (the "parent" coordinate space) to the window's device pixel space
|
||||
double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0;
|
||||
int32_t x = NSToIntRound(aX * scale);
|
||||
int32_t y = NSToIntRound(aY * scale);
|
||||
|
||||
// Check to see if window needs to be moved first
|
||||
// to avoid a costly call to SetWindowPos. This check
|
||||
// can not be moved to the calling code in nsView, because
|
||||
@ -1307,18 +1314,12 @@ NS_METHOD nsWindow::Move(double aX, double aY)
|
||||
// Only perform this check for non-popup windows, since the positioning can
|
||||
// in fact change even when the x/y do not. We always need to perform the
|
||||
// check. See bug #97805 for details.
|
||||
if (mWindowType != eWindowType_popup && (mBounds.x == aX) && (mBounds.y == aY))
|
||||
if (mWindowType != eWindowType_popup && (mBounds.x == x) && (mBounds.y == y))
|
||||
{
|
||||
// Nothing to do, since it is already positioned correctly.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// for top-level windows only, convert coordinates from global display pixels
|
||||
// (the "parent" coordinate space) to the window's device pixel space
|
||||
double scale = BoundsUseDisplayPixels() ? GetDefaultScale() : 1.0;
|
||||
int32_t x = NSToIntRound(aX * scale);
|
||||
int32_t y = NSToIntRound(aY * scale);
|
||||
|
||||
mBounds.x = x;
|
||||
mBounds.y = y;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user