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:
parent
25e2fa44ff
commit
faf6d9976a
1 changed files with 12 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue