[core,update] reset invalid regions at BeginPaint

The client must handle graphics updates in EndPaint.
If we already reached BeginPaint again reset the invalidated regions
as they are already processed and start anew. Fixes #9672
This commit is contained in:
Armin Novak 2023-12-19 15:29:27 +01:00 committed by akallabeth
parent 65da185275
commit b02d4a81b5

View File

@ -3293,9 +3293,25 @@ BOOL update_begin_paint(rdpUpdate* update)
WINPR_ASSERT(update);
rdp_update_lock(update);
WINPR_ASSERT(update->context);
/* Reset the invalid regions, we start a new frame here. */
rdpGdi* gdi = update->context->gdi;
WINPR_ASSERT(gdi);
if (gdi->hdc && gdi->primary && gdi->primary->hdc)
{
HGDI_WND hwnd = gdi->primary->hdc->hwnd;
WINPR_ASSERT(hwnd);
WINPR_ASSERT(hwnd->invalid);
hwnd->invalid->null = TRUE;
hwnd->ninvalid = 0;
}
BOOL rc = IFCALLRESULT(TRUE, update->BeginPaint, update->context);
if (!rc)
WLog_WARN(TAG, "BeginPaint call failed");
return rc;
}