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:
parent
be99ae4c05
commit
cf3dbc8d88
1 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue