[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60577] trunk/blender: Revert revision 59985, 59986, 60046 and 60067.

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Oct 6 16:32:54 CEST 2013


Revision: 60577
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60577
Author:   blendix
Date:     2013-10-06 14:32:53 +0000 (Sun, 06 Oct 2013)
Log Message:
-----------
Revert revision 59985, 59986, 60046 and 60067. These were fixes to improve save
and restore of window setups with multiple monitors, but they are also causing
regressions, in particular issues with Blender overlapping the taskbar and the
user preferences opening wrong. We decided to revert to the old behavior for
the release.

See bug #36707 for the full explanation.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59985

Modified Paths:
--------------
    trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
    trunk/blender/source/blender/windowmanager/intern/wm_window.c

Modified: trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-10-06 12:22:30 UTC (rev 60576)
+++ trunk/blender/intern/ghost/intern/GHOST_WindowWin32.cpp	2013-10-06 14:32:53 UTC (rev 60577)
@@ -176,44 +176,58 @@
 	}
 
 	if (state != GHOST_kWindowStateFullScreen) {
-		RECT rect, desktop;
-		int wintype = WS_OVERLAPPEDWINDOW;
+		RECT rect;
+		MONITORINFO monitor;
+		GHOST_TUns32 tw, th; 
 
-		if (m_parentWindowHwnd != 0) {
-			wintype = WS_CHILD;
-			/* check against parent window if given */
-			GetWindowRect((HWND)m_parentWindowHwnd, &rect);
-		}
-		else {
-			int framex = GetSystemMetrics(SM_CXSIZEFRAME);
-			int framey = GetSystemMetrics(SM_CYSIZEFRAME);
-			int caption = GetSystemMetrics(SM_CYCAPTION);
+		width += GetSystemMetrics(SM_CXSIZEFRAME) * 2;
+		height += GetSystemMetrics(SM_CYSIZEFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION);
 
-			/* set up total window rect, taking in account window decorations. */
-			rect.left = left - framex;
-			rect.right = rect.left + width + framex*2;
-			rect.top = top - (caption + framey);
-			rect.bottom = rect.top + height + (caption + framey * 2);
-		}
+		rect.left = left;
+		rect.right = left + width;
+		rect.top = top;
+		rect.bottom = top + height;
 
-		/* ask how large virtual screen is */
-		desktop.left = GetSystemMetrics(SM_XVIRTUALSCREEN);
-		desktop.top = GetSystemMetrics(SM_YVIRTUALSCREEN);
-		desktop.right = GetSystemMetrics(SM_CXVIRTUALSCREEN);
-		desktop.bottom = GetSystemMetrics(SM_CYVIRTUALSCREEN);
+		monitor.cbSize = sizeof(monitor);
+		monitor.dwFlags = 0;
 
-		/* virtual screen (desktop) bound checks */
-		if (rect.left < desktop.left) rect.left = desktop.left;
-		if (rect.top < desktop.top) rect.top = desktop.top;
-		if (rect.bottom > desktop.bottom) rect.bottom = desktop.bottom;
-		if (rect.right > desktop.right) rect.right = desktop.right;
+		// take taskbar into account
+		GetMonitorInfo(MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST), &monitor);
 
-		/* dimension vars to use in window creation */
-		left = rect.left;
-		top = rect.top;
-		width = rect.right - rect.left;
-		height = rect.bottom - rect.top;
+		th = monitor.rcWork.bottom - monitor.rcWork.top;
+		tw = monitor.rcWork.right - monitor.rcWork.left;
 
+		if (tw < width)
+		{
+			width = tw;
+			left = monitor.rcWork.left;
+		}
+		else if (monitor.rcWork.right < left + (int)width)
+			left = monitor.rcWork.right - width;
+		else if (left < monitor.rcWork.left)
+			left = monitor.rcWork.left;
+
+		if (th < height)
+		{
+			height = th;
+			top = monitor.rcWork.top;
+		}
+		else if (monitor.rcWork.bottom < top + (int)height)
+			top = monitor.rcWork.bottom - height;
+		else if (top < monitor.rcWork.top)
+			top = monitor.rcWork.top;
+
+		int wintype = WS_OVERLAPPEDWINDOW;
+		if (m_parentWindowHwnd != 0)
+		{
+			wintype = WS_CHILD;
+			GetWindowRect((HWND)m_parentWindowHwnd, &rect);
+			left = 0;
+			top = 0;
+			width = rect.right - rect.left;
+			height = rect.bottom - rect.top;
+		}
+		
 		wchar_t *title_16 = alloc_utf16_from_8((char *)(const char *)title, 0);
 		m_hWnd = ::CreateWindowW(
 		    s_windowClassName,          // pointer to registered class name

Modified: trunk/blender/source/blender/windowmanager/intern/wm_window.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_window.c	2013-10-06 12:22:30 UTC (rev 60576)
+++ trunk/blender/source/blender/windowmanager/intern/wm_window.c	2013-10-06 14:32:53 UTC (rev 60577)
@@ -131,7 +131,7 @@
 {
 	int width, height, d;
 	
-	wm_get_desktopsize(&width, &height);
+	wm_get_screensize(&width, &height);
 	
 #if defined(__APPLE__) && !defined(GHOST_COCOA)
 	height -= 70;
@@ -359,7 +359,7 @@
 	if (multisamples == -1)
 		multisamples = U.ogl_multisamples;
 	
-	wm_get_desktopsize(&scr_w, &scr_h);
+	wm_get_screensize(&scr_w, &scr_h);
 	posy = (scr_h - win->posy - win->sizey);
 	
 	ghostwin = GHOST_CreateWindow(g_system, title,




More information about the Bf-blender-cvs mailing list