From 8e6fbe0c90f6f76d4bc9d126edcffe6aea1a7324 Mon Sep 17 00:00:00 2001 From: Doug Lyons Date: Wed, 20 Aug 2025 11:34:44 -0500 Subject: [PATCH] [NTUSER][COMCTL32] Fix garbage displayed at bottom of listbox.c (#8316) CORE-20062 @I_Kill_Bugs fix for rect.bottom in LISTBOX_Paint function. --- dll/win32/comctl32/listbox.c | 4 +++- win32ss/user/user32/controls/listbox.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/win32/comctl32/listbox.c b/dll/win32/comctl32/listbox.c index 709a9a1241a..e2fa2ef9dc5 100644 --- a/dll/win32/comctl32/listbox.c +++ b/dll/win32/comctl32/listbox.c @@ -1129,7 +1129,9 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) /* keep the focus rect, to paint the focus item after */ if (i == descr->focus_item) focusRect = rect; - +#ifdef __REACTOS__ + rect.bottom = min(rect.bottom, descr->height); +#endif LISTBOX_PaintItem( descr, hdc, &rect, i, ODA_DRAWENTIRE, TRUE ); rect.top = rect.bottom; diff --git a/win32ss/user/user32/controls/listbox.c b/win32ss/user/user32/controls/listbox.c index 195241d1884..3d98ac3822f 100644 --- a/win32ss/user/user32/controls/listbox.c +++ b/win32ss/user/user32/controls/listbox.c @@ -1076,7 +1076,9 @@ static LRESULT LISTBOX_Paint( LB_DESCR *descr, HDC hdc ) /* keep the focus rect, to paint the focus item after */ if (i == descr->focus_item) focusRect = rect; - +#ifdef __REACTOS__ + rect.bottom = min(rect.bottom, descr->height); +#endif LISTBOX_PaintItem( descr, hdc, &rect, i, ODA_DRAWENTIRE, TRUE ); rect.top = rect.bottom;