[COMCTL32] Fix header redraw glitches when resizing (#6799)

Fixes COMCTL32 headers from being garbage text when resizing while drawn off screen.

- Invalidate header item rect before scrolling to prevent the divider from being redrawn over and over.
- Invalidate header item text through adding flag SW_INVALIDATE to ScrollWindowEx call to prevent the text from being redrawn over and over.

CORE-19404
This commit is contained in:
Ryan Kounter 2024-04-27 11:56:03 -04:00 committed by GitHub
parent b8e50f787d
commit ab72bc06d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1948,13 +1948,21 @@ HEADER_MouseMove (HEADER_INFO *infoPtr, LPARAM lParam)
if (nWidth < 0) nWidth = 0;
infoPtr->items[infoPtr->iMoveItem].cxy = nWidth;
#ifdef __REACTOS__
InvalidateRect(infoPtr->hwndSelf, &lpItem->rect, FALSE);
#endif
HEADER_SetItemBounds(infoPtr);
GetClientRect(infoPtr->hwndSelf, &rcClient);
rcScroll = rcClient;
rcScroll.left = lpItem->rect.left + nOldWidth;
#ifdef __REACTOS__
ScrollWindowEx(infoPtr->hwndSelf, nWidth - nOldWidth, 0, &rcScroll, &rcClient,
NULL, NULL, SW_INVALIDATE);
#else
ScrollWindowEx(infoPtr->hwndSelf, nWidth - nOldWidth, 0, &rcScroll, &rcClient, NULL, NULL, 0);
InvalidateRect(infoPtr->hwndSelf, &lpItem->rect, FALSE);
#endif
UpdateWindow(infoPtr->hwndSelf);
HEADER_SendNotifyWithIntFieldT(infoPtr, HDN_ITEMCHANGEDW, infoPtr->iMoveItem, HDI_WIDTH, nWidth);