Fix T42489 and T52936: Loading blend with minimized window results in crash or empty screen on windows.
Reviewed By: @brecht , @sergey Differential Revision: http://developer.blender.org/D2866
This commit is contained in:
parent
296757804c
commit
57d7e5b6ee
@ -402,6 +402,7 @@ void GHOST_WindowWin32::getClientBounds(GHOST_Rect &bounds) const
|
||||
{
|
||||
RECT rect;
|
||||
POINT coord;
|
||||
if (!IsIconic(m_hWnd)) {
|
||||
::GetClientRect(m_hWnd, &rect);
|
||||
|
||||
coord.x = rect.left;
|
||||
@ -417,6 +418,13 @@ void GHOST_WindowWin32::getClientBounds(GHOST_Rect &bounds) const
|
||||
|
||||
bounds.m_r = coord.x;
|
||||
bounds.m_b = coord.y;
|
||||
}
|
||||
else {
|
||||
bounds.m_b = 0;
|
||||
bounds.m_l = 0;
|
||||
bounds.m_r = 0;
|
||||
bounds.m_t = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -477,8 +477,12 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm
|
||||
|
||||
/* store actual window size in blender window */
|
||||
bounds = GHOST_GetClientBounds(win->ghostwin);
|
||||
|
||||
/* win32: gives undefined window size when minimized */
|
||||
if (GHOST_GetWindowState(win->ghostwin) != GHOST_kWindowStateMinimized) {
|
||||
win->sizex = GHOST_GetWidthRectangle(bounds);
|
||||
win->sizey = GHOST_GetHeightRectangle(bounds);
|
||||
}
|
||||
GHOST_DisposeRectangle(bounds);
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
Loading…
Reference in New Issue
Block a user