forked from bartvdbraak/blender
Remove dimension checks from window creation.
This should be (and is) done by the caller instead (windowmanager) to ensure new windows fit properly on the desktop. Saving stretched layouts and layouts with window over display boundaries now becomes possible on Windows too.
This commit is contained in:
parent
b6a6074b56
commit
46db99e7fd
@ -177,46 +177,12 @@ GHOST_WindowWin32::GHOST_WindowWin32(
|
|||||||
|
|
||||||
if (state != GHOST_kWindowStateFullScreen) {
|
if (state != GHOST_kWindowStateFullScreen) {
|
||||||
RECT rect;
|
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.left = left;
|
||||||
rect.right = left + width;
|
rect.right = left + width;
|
||||||
rect.top = top;
|
rect.top = top;
|
||||||
rect.bottom = top + height;
|
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;
|
int wintype = WS_OVERLAPPEDWINDOW;
|
||||||
if (m_parentWindowHwnd != 0)
|
if (m_parentWindowHwnd != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user