1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Windows: Fix WM_NCCALCSIZE behaviour for frameless windows on multiple display systems

Previously, maximising a frameless window on a secondary display could
result in the window's coordinates being computed incorrectly, leading
to graphical glitches.
This commit is contained in:
reuk 2024-08-29 17:15:59 +01:00
parent 25e2fa44ff
commit faf6d9976a
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -3938,8 +3938,17 @@ private:
// so that the client area exactly fills the available space.
if (isFullScreen())
{
const auto padX = -param->left;
const auto padY = -param->top;
const auto monitor = MonitorFromWindow (hwnd, MONITOR_DEFAULTTONULL);
if (monitor == nullptr)
return 0;
MONITORINFOEX info{};
info.cbSize = sizeof (info);
GetMonitorInfo (monitor, &info);
const auto padX = info.rcMonitor.left - param->left;
const auto padY = info.rcMonitor.top - param->top;
param->left += padX;
param->right -= padX;
@ -5242,7 +5251,7 @@ private:
public:
LowLevelGraphicsContext* startFrame (HWND hwnd, float scale, const RectangleList<int>& dirty)
{
RECT r;
RECT r{};
GetClientRect (hwnd, &r);
const auto w = r.right - r.left;