Bug 1513066 - Scale monitor size when forcing fullscreen. r=jmathies, a=RyanVM
authorAdam Gashlin <agashlin@mozilla.com>
Thu, 13 Dec 2018 20:35:23 +0000
changeset 509012 cfbe2471b45affb76f28b0574e46e74c712fe626
parent 509011 395d963105c1c9f58e68b6ebec1bb4c622855fed
child 509013 b1c4313b5f4f01c07d18eb054ef5d9d68eb3cd58
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies, RyanVM
bugs1513066
milestone65.0
Bug 1513066 - Scale monitor size when forcing fullscreen. r=jmathies, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D14328
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6506,21 +6506,22 @@ void nsWindow::OnWindowPosChanging(LPWIN
     if (screenmgr) {
       nsCOMPtr<nsIScreen> screen;
       screenmgr->ScreenForRect(info->x, info->y, info->cx, info->cy,
                                getter_AddRefs(screen));
 
       if (screen) {
         int32_t x, y, width, height;
         screen->GetRectDisplayPix(&x, &y, &width, &height);
-
-        info->x = x;
-        info->y = y;
-        info->cx = width;
-        info->cy = height;
+        double scale = GetDesktopToDeviceScale().scale;
+
+        info->x = NSToIntRound(x * scale);
+        info->y = NSToIntRound(y * scale);
+        info->cx = NSToIntRound(width * scale);
+        info->cy = NSToIntRound(height * scale);
       }
     }
   }
 
   // enforce local z-order rules
   if (!(info->flags & SWP_NOZORDER)) {
     HWND hwndAfter = info->hwndInsertAfter;