Bug 1245442 - Backout cset 9bde73f95ead (part 9 from bug 890156) for breaking the minimize/maximize/close buttons when a window is maximized on a monitor with non-system DPI. r=emk
authorJonathan Kew <jkew@mozilla.com>
Tue, 01 Mar 2016 12:08:35 +0000
changeset 322606 e3a41a0486eebca77e59e90d1585ffe9c53e4851
parent 322605 bd725321463610780d209963e9a6999d52faff0e
child 322607 df6847768408ed5a157913f2db8b23c495549540
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemk
bugs1245442, 890156
milestone47.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 1245442 - Backout cset 9bde73f95ead (part 9 from bug 890156) for breaking the minimize/maximize/close buttons when a window is maximized on a monitor with non-system DPI. r=emk
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -2321,28 +2321,16 @@ nsWindow::UpdateNonClientMargins(int32_t
     // makes the whole caption part of our client area, allowing us to draw
     // in the whole caption area.  Use default frame size on left, right, and
     // bottom. The reason this works is that, for maximized windows,
     // Windows positions them so that their frames fall off the screen.
     // This gives the illusion of windows having no frames when they are
     // maximized.  If we try to mess with the frame sizes by setting these
     // offsets to positive values, our client area will fall off the screen.
     mNonClientOffset.top = mCaptionHeight;
-    // Adjust for the case where the window is maximized on a screen with DPI
-    // different from the primary monitor; this seems to be linked to Windows'
-    // failure to scale the non-client area the same as the client area.
-    // Any modifications here need to be tested for both high- and low-dpi
-    // secondary displays, and for windows both with and without the titlebar
-    // and/or menubar displayed.
-    double ourScale = WinUtils::LogToPhysFactor(mWnd);
-    double primaryScale =
-      WinUtils::LogToPhysFactor(WinUtils::GetPrimaryMonitor());
-    mNonClientOffset.top +=
-      NSToIntRound(mVertResizeMargin * (ourScale - primaryScale));
-
     mNonClientOffset.bottom = 0;
     mNonClientOffset.left = 0;
     mNonClientOffset.right = 0;
 
     APPBARDATA appBarData;
     appBarData.cbSize = sizeof(appBarData);
     UINT taskbarState = SHAppBarMessage(ABM_GETSTATE, &appBarData);
     if (ABS_AUTOHIDE & taskbarState) {