Bug 1259065 - Don't constrain window position (only its size) when DPI-rescaling during a move. r=emk a=ritu

MozReview-Commit-ID: Dx8o4tFYBU3
This commit is contained in:
Jonathan Kew 2016-03-23 17:54:45 +00:00
parent e9497b735e
commit 4207c0244b

View File

@ -6903,7 +6903,8 @@ nsWindow::OnDPIChanged(int32_t x, int32_t y, int32_t width, int32_t height)
height = h;
}
// Limit the position & size, if it would overflow the destination screen
// Limit the position (if not in the middle of a drag-move) & size,
// if it would overflow the destination screen
nsCOMPtr<nsIScreenManager> sm = do_GetService(sScreenManagerContractID);
if (sm) {
nsCOMPtr<nsIScreen> screen;
@ -6911,8 +6912,10 @@ nsWindow::OnDPIChanged(int32_t x, int32_t y, int32_t width, int32_t height)
if (screen) {
int32_t availLeft, availTop, availWidth, availHeight;
screen->GetAvailRect(&availLeft, &availTop, &availWidth, &availHeight);
x = std::max(x, availLeft);
y = std::max(y, availTop);
if (mResizeState != MOVING) {
x = std::max(x, availLeft);
y = std::max(y, availTop);
}
width = std::min(width, availWidth);
height = std::min(height, availHeight);
}