Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-01-29 00:35:55 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-01-29 00:37:40 +0400
commit52ea13e97087f9a1d604708fe821fcf04d35aba6 (patch)
treef9c96c339118696e54fb8ae660cced894b2b9a9b /intern/ghost
parentae46e8a6982c5c5a9b79dcd1d4f57b84c40e2d91 (diff)
Fix T37999: incorrect windows size with Visual Studio 2013 builds.
This is a known bug in Windows, now work around it. https://bugreports.qt-project.org/browse/QTBUG-36192 http://connect.microsoft.com/VisualStudio/feedback/details/753224/regression-getsystemmetrics-delivers-different-values
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index f5b716618e3..8436e3b0242 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -180,8 +180,21 @@ GHOST_WindowWin32::GHOST_WindowWin32(
MONITORINFO monitor;
GHOST_TUns32 tw, th;
- width += GetSystemMetrics(SM_CXSIZEFRAME) * 2;
- height += GetSystemMetrics(SM_CYSIZEFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION);
+#if !defined(_MSC_VER) || _MSC_VER < 1700
+ int cxsizeframe = GetSystemMetrics(SM_CXSIZEFRAME);
+ int cysizeframe = GetSystemMetrics(SM_CYSIZEFRAME);
+#else
+ // MSVC 2012+ returns bogus values from GetSystemMetrics, bug in Windows
+ // http://connect.microsoft.com/VisualStudio/feedback/details/753224/regression-getsystemmetrics-delivers-different-values
+ RECT cxrect = {0, 0, 0, 0};
+ AdjustWindowRectEx(&cxrect, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_THICKFRAME | WS_DLGFRAME, FALSE, 0);
+
+ int cxsizeframe = abs(cxrect.bottom);
+ int cysizeframe = abs(cxrect.left);
+#endif
+
+ width += cxsizeframe * 2;
+ height += cysizeframe * 2 + GetSystemMetrics(SM_CYCAPTION);
rect.left = left;
rect.right = left + width;