Invalidate the focused item when scrolling horizontally so that it
repaints correctly.
diff --git a/controls/listbox.c b/controls/listbox.c
index 5c5cca4..5916a17 100644
--- a/controls/listbox.c
+++ b/controls/listbox.c
@@ -1210,8 +1210,14 @@
descr->horz_pos = pos;
LISTBOX_UpdateScroll( hwnd, descr );
if (abs(diff) < descr->width)
+ {
+ RECT rect;
+ /* Invalidate the focused item so it will be repainted correctly */
+ if (LISTBOX_GetItemRect( descr, descr->focus_item, &rect ) == 1)
+ InvalidateRect( hwnd, &rect, TRUE );
ScrollWindowEx( hwnd, diff, 0, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
+ }
else
InvalidateRect( hwnd, NULL, TRUE );
}