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.
This commit is contained in:
@@ -176,44 +176,58 @@ GHOST_WindowWin32::GHOST_WindowWin32(
|
||||
}
|
||||
|
||||
if (state != GHOST_kWindowStateFullScreen) {
|
||||
RECT rect, desktop;
|
||||
RECT rect;
|
||||
MONITORINFO monitor;
|
||||
GHOST_TUns32 tw, th;
|
||||
|
||||
width += GetSystemMetrics(SM_CXSIZEFRAME) * 2;
|
||||
height += GetSystemMetrics(SM_CYSIZEFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION);
|
||||
|
||||
rect.left = left;
|
||||
rect.right = left + width;
|
||||
rect.top = top;
|
||||
rect.bottom = top + height;
|
||||
|
||||
monitor.cbSize = sizeof(monitor);
|
||||
monitor.dwFlags = 0;
|
||||
|
||||
// take taskbar into account
|
||||
GetMonitorInfo(MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST), &monitor);
|
||||
|
||||
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) {
|
||||
if (m_parentWindowHwnd != 0)
|
||||
{
|
||||
wintype = WS_CHILD;
|
||||
/* check against parent window if given */
|
||||
GetWindowRect((HWND)m_parentWindowHwnd, &rect);
|
||||
left = 0;
|
||||
top = 0;
|
||||
width = rect.right - rect.left;
|
||||
height = rect.bottom - rect.top;
|
||||
}
|
||||
else {
|
||||
int framex = GetSystemMetrics(SM_CXSIZEFRAME);
|
||||
int framey = GetSystemMetrics(SM_CYSIZEFRAME);
|
||||
int caption = 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);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* dimension vars to use in window creation */
|
||||
left = rect.left;
|
||||
top = rect.top;
|
||||
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
|
||||
|
@@ -131,7 +131,7 @@ static void wm_window_check_position(rcti *rect)
|
||||
{
|
||||
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 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
|
||||
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,
|
||||
|
Reference in New Issue
Block a user