forked from bartvdbraak/blender
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:
parent
eeea2cec0d
commit
82501bbec5
@ -117,16 +117,18 @@ GHOST_WindowWin32::GHOST_WindowWin32(
|
||||
m_maxPressure(0)
|
||||
{
|
||||
if (state != GHOST_kWindowStateFullScreen) {
|
||||
/* Convert client size into window size */
|
||||
width += GetSystemMetrics(SM_CXSIZEFRAME)*2;
|
||||
height += GetSystemMetrics(SM_CYSIZEFRAME)*2 + GetSystemMetrics(SM_CYCAPTION);
|
||||
// take taskbar into account
|
||||
RECT rect;
|
||||
SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
|
||||
height = rect.bottom - rect.top;
|
||||
width = rect.right - rect.left;
|
||||
|
||||
m_hWnd = ::CreateWindow(
|
||||
s_windowClassName, // pointer to registered class name
|
||||
title, // pointer to window name
|
||||
WS_OVERLAPPEDWINDOW, // window style
|
||||
left, // horizontal position of window
|
||||
top, // vertical position of window
|
||||
rect.left, // horizontal position of window
|
||||
rect.top, // vertical position of window
|
||||
width, // window width
|
||||
height, // window height
|
||||
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
|
||||
{
|
||||
RECT rect;
|
||||
::GetWindowRect(m_hWnd, &rect);
|
||||
|
||||
LONG_PTR result = ::GetWindowLongPtr(m_hWnd, GWL_STYLE);
|
||||
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_l = rect.left;
|
||||
bounds.m_r = rect.right-GetSystemMetrics(SM_CYSIZEFRAME)*2;
|
||||
bounds.m_t = rect.top;
|
||||
} else {
|
||||
::GetWindowRect(m_hWnd, &rect);
|
||||
bounds.m_b = rect.bottom;
|
||||
bounds.m_l = rect.left;
|
||||
bounds.m_r = rect.right;
|
||||
|
Loading…
Reference in New Issue
Block a user