From: Jacob Czekalla jczekalla@codeweavers.com
The cached header rects need to be updated otherwise hittest will return wrong subitem. --- dlls/comctl32/listview.c | 1 + dlls/comctl32/tests/listview.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 31f8a933e56..43701ccc729 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -7654,6 +7654,7 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, /* set whole list relation flags */ if (subitem && infoPtr->uView == LV_VIEW_DETAILS) { + ((LISTVIEW_INFO *)infoPtr)->colRectsDirty = TRUE; /* LVM_SUBITEMHITTEST checks left bound of possible client area */ if (infoPtr->rcList.left > lpht->pt.x && Origin.x < lpht->pt.x) lpht->flags |= LVHT_TOLEFT; diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 1020f28b092..61f8ee1ee58 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -7536,7 +7536,6 @@ static void test_column_rect_caching(void) ZeroMemory(&hit_info, sizeof(hit_info)); hit_info.pt = pt; SendMessageA(listview, LVM_SUBITEMHITTEST, 0, (LPARAM)&hit_info); - todo_wine ok(hit_info.iSubItem == 1, "expected 1, but got %d\n", hit_info.iSubItem);
DestroyWindow(listview);