Win GUI fix: Blender won't hide behind the taskbar anymore on startup (in non maximized mode). Until now, the bottom of Blender always got hidden behind the taskbar - verified to fix at least Win7 + XP

- Windows devs (elubie, jesterKing): please check this fix.
This commit is contained in:
Daniel Genrich 2009-06-07 23:36:34 +00:00
parent eeea2cec0d
commit 82501bbec5

@ -117,16 +117,18 @@ GHOST_WindowWin32::GHOST_WindowWin32(
m_maxPressure(0) m_maxPressure(0)
{ {
if (state != GHOST_kWindowStateFullScreen) { if (state != GHOST_kWindowStateFullScreen) {
/* Convert client size into window size */ // take taskbar into account
width += GetSystemMetrics(SM_CXSIZEFRAME)*2; RECT rect;
height += GetSystemMetrics(SM_CYSIZEFRAME)*2 + GetSystemMetrics(SM_CYCAPTION); SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
height = rect.bottom - rect.top;
width = rect.right - rect.left;
m_hWnd = ::CreateWindow( m_hWnd = ::CreateWindow(
s_windowClassName, // pointer to registered class name s_windowClassName, // pointer to registered class name
title, // pointer to window name title, // pointer to window name
WS_OVERLAPPEDWINDOW, // window style WS_OVERLAPPEDWINDOW, // window style
left, // horizontal position of window rect.left, // horizontal position of window
top, // vertical position of window rect.top, // vertical position of window
width, // window width width, // window width
height, // window height height, // window height
0, // handle to parent or owner window 0, // handle to parent or owner window
@ -297,15 +299,17 @@ void GHOST_WindowWin32::getWindowBounds(GHOST_Rect& bounds) const
void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const void GHOST_WindowWin32::getClientBounds(GHOST_Rect& bounds) const
{ {
RECT rect; RECT rect;
::GetWindowRect(m_hWnd, &rect);
LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE); LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) { if((result & (WS_POPUP | WS_MAXIMIZE)) != (WS_POPUP | WS_MAXIMIZE)) {
SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYSIZEFRAME)*2; bounds.m_b = rect.bottom-GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYSIZEFRAME)*2;
bounds.m_l = rect.left; bounds.m_l = rect.left;
bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2; bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2;
bounds.m_t = rect.top; bounds.m_t = rect.top;
} else { } else {
::GetWindowRect(m_hWnd, &rect);
bounds.m_b = rect.bottom; bounds.m_b = rect.bottom;
bounds.m_l = rect.left; bounds.m_l = rect.left;
bounds.m_r = rect.right; bounds.m_r = rect.right;