Bug 1368882 - Prevent ClientSize becomes minus value r=jrmuizel
authorsotaro <sotaro.ikeda.g@gmail.com>
Mon, 12 Jun 2017 12:44:49 +0900
changeset 411560 07b5b1e2ed4b665b6f01fc8a9d98faad65df5c21
parent 411559 b2fe8f4df7010f229348fdd1da1459ec78617a39
child 411561 f9605772a0c9098ed1bcaa98089b2c944ed69e9b
child 412191 5b483c5bb3d4384ec0d6efb365d9c4aa8967a3bd
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1368882
milestone55.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 1368882 - Prevent ClientSize becomes minus value r=jrmuizel
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -5237,16 +5237,20 @@ nsWindow::ProcessMessage(UINT msg, WPARA
         clientRect->top +=
           NSToIntRound((mCaptionHeight - mNonClientOffset.top) * scale);
         clientRect->left +=
           NSToIntRound((mHorResizeMargin - mNonClientOffset.left) * scale);
         clientRect->right -=
           NSToIntRound((mHorResizeMargin - mNonClientOffset.right) * scale);
         clientRect->bottom -=
           NSToIntRound((mVertResizeMargin - mNonClientOffset.bottom) * scale);
+        // Make client rect's width and height more than 0 to
+        // avoid problems of webrender and angle.
+        clientRect->right = std::max(clientRect->right, clientRect->left + 1);
+        clientRect->bottom = std::max(clientRect->bottom, clientRect->top + 1);
 
         result = true;
         *aRetValue = 0;
       }
       break;
     }
 
     case WM_NCHITTEST: