From d396bd92ee13a1e996c30b9e49db974e3f7d5198 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 11 Sep 2013 14:14:18 +0000 Subject: Fix [#36702] blenderapplication window position and size On Windows the system window will be sized an positioned such that Blender screen area lower left corner is at the requested location, and with dimension as requested. Thanks to Alexander N. for reporting and Brecht van Lommel for input. --- intern/ghost/intern/GHOST_WindowWin32.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 10f8a507e35..362a045e5c7 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -178,10 +178,19 @@ GHOST_WindowWin32::GHOST_WindowWin32( if (state != GHOST_kWindowStateFullScreen) { RECT rect; + int framex = GetSystemMetrics(SM_CXSIZEFRAME); + int framey = GetSystemMetrics(SM_CYSIZEFRAME); + int caption = GetSystemMetrics(SM_CYCAPTION); + width += framex * 2; + height += framey * 2 + caption; + + left -= framex; + top -= (caption+framey); + rect.left = left; - rect.right = left + width; + rect.right = left + width + framex; rect.top = top; - rect.bottom = top + height; + rect.bottom = top + height + caption - framey; int wintype = WS_OVERLAPPEDWINDOW; if (m_parentWindowHwnd != 0) -- cgit v1.2.3