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:
Timothy Nikkel 2013-04-20 13:19:26 -05:00
Родитель bfcf81990d
Коммит ef9ea7f803
1 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -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;