diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 905c8f10c80..60c83273992 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -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 sm = do_GetService(sScreenManagerContractID); if (sm) { nsCOMPtr 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); }