From: Zhiyi Zhang zzhang@codeweavers.com
Comctl32 v5 listview sends custom draw messages with TRANSPARENT background mix mode. Comctl32 v6 listview sends custom draw messages with OPAQUE first to draw headers, then send the another round of custom draw messages sequence with TRANSPARENT to draw items. Wine's comctl32 currently doesn't draw headers separately. So it seems reasonable to set TRANSPARENT for the complete custom draw message sequence on Wine for now. --- dlls/comctl32/listview.c | 9 ++------- dlls/comctl32/tests/listview.c | 9 ++++++--- 2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 31f8a933e56..486ec074cd1 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1120,13 +1120,7 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, const NMLVCUS textcolor = comctl32_color.clrWindowText;
/* Set the text attributes */ - if (backcolor != CLR_NONE) - { - SetBkMode(hdc, OPAQUE); - SetBkColor(hdc, backcolor); - } - else - SetBkMode(hdc, TRANSPARENT); + SetBkColor(hdc, backcolor); SetTextColor(hdc, textcolor); }
@@ -5269,6 +5263,7 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY); }
+ SetBkMode(hdc, TRANSPARENT); GetClientRect(infoPtr->hwndSelf, &rcClient); customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 8eb04ba55ef..5cb4d142ec5 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2381,7 +2381,8 @@ static void test_customdraw_background(BOOL v6) flush_sequences(sequences, NUM_MSG_SEQUENCES); InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); - ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "Normal", TRUE); + ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "Normal", + v6 && (test_styles[i] & LVS_TYPEMASK) == LVS_REPORT);
/* LVIS_SELECTED */ item.mask = LVIF_STATE; @@ -2392,7 +2393,8 @@ static void test_customdraw_background(BOOL v6) flush_sequences(sequences, NUM_MSG_SEQUENCES); InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); - ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "LVIS_SELECTED", TRUE); + ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "LVIS_SELECTED", + v6 && (test_styles[i] & LVS_TYPEMASK) == LVS_REPORT);
/* LVS_SHOWSELALWAYS */ SetWindowLongW(hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) | LVS_SHOWSELALWAYS); @@ -2400,7 +2402,8 @@ static void test_customdraw_background(BOOL v6) flush_sequences(sequences, NUM_MSG_SEQUENCES); InvalidateRect(hwnd, NULL, TRUE); UpdateWindow(hwnd); - ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "LVS_SHOWSELALWAYS", TRUE); + ok_sequence(sequences, PARENT_CD_SEQ_INDEX, expected_msgs, "LVS_SHOWSELALWAYS", + v6 && (test_styles[i] & LVS_TYPEMASK) == LVS_REPORT);
SetWindowLongPtrA(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc); flush_sequences(sequences, NUM_MSG_SEQUENCES);