Bug 1259065 - Don't constrain window position (only its size) when DPI-rescaling during a move. r=emk
authorJonathan Kew <jkew@mozilla.com>
Wed, 23 Mar 2016 17:54:45 +0000
changeset 290219 7b686e0a9ce4c5f1970b30ffbc4885a9ff29b9bf
parent 290218 3d3834cc0e364737f56ba4f8c575d25c48800f2c
child 290220 7b617908d5430b944b1f61f9e50d28e9e0a93c7b
push id30114
push usercbook@mozilla.com
push dateThu, 24 Mar 2016 15:15:54 +0000
treeherdermozilla-central@24c5fbde4488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1259065
milestone48.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 1259065 - Don't constrain window position (only its size) when DPI-rescaling during a move. r=emk
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6895,26 +6895,29 @@ nsWindow::OnDPIChanged(int32_t x, int32_
       int32_t h = sr.height - cr.height + NSToIntRound(cr.height * ratio);
       // Adjust x and y to preserve the center point of the suggested rect.
       x -= (w - width) / 2;
       y -= (h - height) / 2;
       width = w;
       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;
       sm->ScreenForRect(x, y, width, height, getter_AddRefs(screen));
       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);
       }
     }
 
     Resize(x, y, width, height, true);
   }
   ChangedDPI();