Bug 1259065 - Don't constrain window position (only its size) when DPI-rescaling during a move. r=emk a=ritu
authorJonathan Kew <jkew@mozilla.com>
Wed, 23 Mar 2016 17:54:45 +0000
changeset 310300 236975b1c2529c57b6b061c02dd71ca57ee0ef17
parent 310299 d4cd004b67f433f5f2539e0114eb7fb93c826502
child 310301 407be5a3b4f28626900f16c15a24a4420d1a56d0
push id9319
push userkwierso@gmail.com
push dateMon, 28 Mar 2016 18:09:46 +0000
treeherdermozilla-aurora@236975b1c252 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk, ritu
bugs1259065
milestone47.0a2
Bug 1259065 - Don't constrain window position (only its size) when DPI-rescaling during a move. r=emk a=ritu MozReview-Commit-ID: Dx8o4tFYBU3
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6898,26 +6898,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();