Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions src/Notepad3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading