1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-30 02:50:05 +00:00

UpdateRegion: Validate window on receiving NULLREGION

This fixes a bug where opening a foreground window could occasionally
prevent background windows from repainting. The symptom seems to be
caused by the system repeatedly sending WM_PAINT messages to the
foreground window and ignoring the background window. It seems that the
system will repeatedly call WM_PAINT until the entire region has been
validated - even if that region is null.
This commit is contained in:
reuk 2026-01-16 16:51:13 +00:00
parent be99ae4c05
commit cf3dbc8d88
No known key found for this signature in database

View file

@ -375,9 +375,15 @@ void UpdateRegion::findRECTAndValidate (HWND windowHandle)
const ScopeGuard regionDeleter { [&] { DeleteObject (regionHandle); } };
const auto regionType = GetUpdateRgn (windowHandle, regionHandle, false);
if (regionType == ERROR || regionType == NULLREGION)
if (regionType == ERROR)
return;
if (regionType == NULLREGION)
{
ValidateRect (windowHandle, nullptr);
return;
}
const auto requiredBytes = GetRegionData (regionHandle, 0, nullptr);
block.ensureSize (requiredBytes);