[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60046] trunk/blender/intern/ghost/intern/ GHOST_WindowWin32.cpp: Fix [#36702] blenderapplication window position and size

Nathan Letwory nathan at letworyinteractive.com
Wed Sep 11 16:14:18 CEST 2013


Revision: 60046
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60046
Author:   jesterking
Date:     2013-09-11 14:14:18 +0000 (Wed, 11 Sep 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-09-11 12:13:20 UTC (rev 60045)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-09-11 14:14:18 UTC (rev 60046)
@@ -178,10 +178,19 @@
 	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)




More information about the Bf-blender-cvs mailing list