From ab72bc06d69b8908435c21c9d4b907e109d4c7db Mon Sep 17 00:00:00 2001 From: Ryan Kounter Date: Sat, 27 Apr 2024 11:56:03 -0400 Subject: [PATCH] [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 --- dll/win32/comctl32/header.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dll/win32/comctl32/header.c b/dll/win32/comctl32/header.c index a48530d8882..e72324ce1f1 100644 --- a/dll/win32/comctl32/header.c +++ b/dll/win32/comctl32/header.c @@ -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);