JBR-1770 [windows] frame does not open as maximized

(cherry picked from commit d9dfc3c6c5)
This commit is contained in:
Anton Tarasov
2019-08-21 14:41:50 +03:00
committed by Vitaly Provodin
parent 0c94851700
commit aaaade5dae

View File

@@ -1419,6 +1419,16 @@ void AwtFrame::_SetState(void *param)
f->setIconic(iconify);
f->setZoomed(zoom);
// [tav] With custom decor enabled, MS Win will send WM_SIZE msg w/o SIZE_MAXIMIZED param set
// before the frame will be shown. The msg handler will drop the maximized state in response.
// In order to prevent that, we set the maximized state on the native frame in advance.
if (zoom && f->HasCustomDecoration()) {
WINDOWPLACEMENT wp;
::GetWindowPlacement(f->GetHWnd(), &wp);
wp.showCmd = SW_SHOWMAXIMIZED;
::SetWindowPlacement(f->GetHWnd(), &wp);
}
}
}
ret: