When creating Win32 windows, the sizes and placements can be out by a small amount, mostly noticeable near monitor edges. This is because Windows 10 includes a thin invisible border (typically 7 pixels) when determining position. Therefore the correct values can sometimes be just outside the monitor bounds, but we clamp them at those bounds. This patch fixes this by first clamping the requested values to monitor bounds, adjusting for window chrome with AdjustWindowRectEx(), and then using those adjusted values in CreateWindowExW(). see D11314 for more details. Differential Revision: https://developer.blender.org/D11314 Reviewed by Ray Molenkamp