Fix window maximising to it's minimum size
This commit is contained in:
parent
dd4ae0d793
commit
ea1f8dcc38
@ -184,9 +184,15 @@ FILE_SCOPE LRESULT CALLBACK win32_main_proc_callback(HWND window, UINT msg,
|
|||||||
|
|
||||||
case WM_GETMINMAXINFO:
|
case WM_GETMINMAXINFO:
|
||||||
{
|
{
|
||||||
|
RECT rect = {};
|
||||||
|
rect.right = MIN_WIDTH;
|
||||||
|
rect.bottom = MIN_HEIGHT;
|
||||||
|
DWORD windowStyle = (DWORD)GetWindowLong(window, GWL_STYLE);
|
||||||
|
AdjustWindowRect(&rect, windowStyle, true);
|
||||||
|
|
||||||
MINMAXINFO *mmi = (MINMAXINFO *)lParam;
|
MINMAXINFO *mmi = (MINMAXINFO *)lParam;
|
||||||
mmi->ptMaxSize.x = MIN_WIDTH;
|
mmi->ptMinTrackSize.x = rect.left - rect.right;
|
||||||
mmi->ptMaxSize.y = MIN_HEIGHT;
|
mmi->ptMinTrackSize.y = rect.bottom - rect.top;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user