JBR-1293 do not modify client bounds when custom-decorated frame is set undecorated

(cherry picked from commit cb188edaab)
This commit is contained in:
Anton Tarasov
2019-03-26 10:15:50 +03:00
committed by alexey.ushakov@jetbrains.com
parent de4c37bfc1
commit fc3c412dba

View File

@@ -1674,9 +1674,13 @@ BOOL AwtFrame::HasCustomDecoration()
return *m_pHasCustomDecoration;
}
void GetSysInsets(RECT* insets) {
void GetSysInsets(RECT* insets, AwtFrame* pFrame) {
static RECT* sysInsets = NULL;
if (pFrame->IsUndecorated()) {
::SetRect(insets, 0, 0, 0, 0);
return;
}
if (!sysInsets) {
sysInsets = new RECT;
sysInsets->left = sysInsets->right = ::GetSystemMetrics(SM_CXSIZEFRAME);
@@ -1690,7 +1694,7 @@ LRESULT HitTestNCA(AwtFrame* frame, int x, int y) {
RECT rcWindow;
RECT insets;
GetSysInsets(&insets);
GetSysInsets(&insets, frame);
GetWindowRect(frame->GetHWnd(), &rcWindow);
// Get the frame rectangle, adjusted for the style without a caption.
@@ -1743,9 +1747,8 @@ MsgRouting AwtFrame::WmNcCalcSize(BOOL wParam, LPNCCALCSIZE_PARAMS lpncsp, LRESU
if (!wParam || !HasCustomDecoration()) {
return AwtWindow::WmNcCalcSize(wParam, lpncsp, retVal);
}
RECT insets;
GetSysInsets(&insets);
GetSysInsets(&insets, this);
RECT* rect = &lpncsp->rgrc[0];
rect->left = rect->left + insets.left;