Merge pull request #5836 from RaiKoHoff/dev_master

fix: small correction of factory default position
This commit is contained in:
Rainer Kottenhoff 2026-05-08 13:03:45 +02:00 committed by GitHub
commit e694c59cfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1558,13 +1558,15 @@ WININFO GetFactoryDefaultWndPos(HWND hwnd, const int flagsPos)
winfo.zoom = 100;
winfo.dpi = dpi;
// extend by DWM invisible border so visible content fills work area
int const border = GetSystemMetrics(SM_CXPADDEDBORDER);
int const sframe = GetSystemMetrics(SM_CXSIZEFRAME);
winfo.x += border;
winfo.y += border;
winfo.cx += (border + sframe);
winfo.cy += (border + sframe);
// extend by DWM invisible border so visible content fills work area;
// the top has no invisible margin (title bar sits at window.top).
// Win11 DWM offset is < SM_CXPADDEDBORDER + SM_CXSIZEFRAME by ~SM_CXBORDER per side.
int const dwmMargin = GetSystemMetrics(SM_CXPADDEDBORDER) +
GetSystemMetrics(SM_CXSIZEFRAME) -
2 * GetSystemMetrics(SM_CXBORDER);
winfo.x -= dwmMargin;
winfo.cx += 2 * dwmMargin;
winfo.cy += dwmMargin; // bottom only
return winfo;
}