From: Zhiyi Zhang zzhang@codeweavers.com
Comctl32 v5 listview sets the initial background mix mode to TRANSPARENT. Comctl32 v6 listview sets it to OPAQUE. Use TRANSPARENT for both v5 and v6 for now. --- dlls/comctl32/listview.c | 10 +++------- dlls/comctl32/tests/listview.c | 4 ---- 2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 31f8a933e56..c5709cf2a4b 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); }
@@ -5271,6 +5265,8 @@ static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, const RECT *prcEra
GetClientRect(infoPtr->hwndSelf, &rcClient); customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); + /* v5 sets the initial background mix mode to TRANSPARENT while v6 uses OPAQUE. */ + SetBkMode(hdc, TRANSPARENT); cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (cdmode & CDRF_SKIPDEFAULT) goto enddraw;
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 386fde36939..bf5afd694c3 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -2104,13 +2104,11 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM switch(nmlvcd->nmcd.dwDrawStage) { case CDDS_PREPAINT: mode = GetBkMode(nmlvcd->nmcd.hdc); - todo_wine ok(mode == TRANSPARENT, "Got unexpected mode.\n"); SetBkColor(nmlvcd->nmcd.hdc, c0ffee); return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPREPAINT: mode = GetBkMode(nmlvcd->nmcd.hdc); - todo_wine ok(mode == TRANSPARENT, "Got unexpected mode.\n"); clr = GetBkColor(nmlvcd->nmcd.hdc); todo_wine_if(nmlvcd->iSubItem) @@ -2120,7 +2118,6 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM return CDRF_NOTIFYSUBITEMDRAW|CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPREPAINT | CDDS_SUBITEM: mode = GetBkMode(nmlvcd->nmcd.hdc); - todo_wine ok(mode == TRANSPARENT, "Got unexpected mode.\n"); clr = GetBkColor(nmlvcd->nmcd.hdc); ok(nmlvcd->clrTextBk == CLR_DEFAULT, "Unexpected text background %#lx.\n", nmlvcd->clrTextBk); @@ -2133,7 +2130,6 @@ static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM return CDRF_NOTIFYPOSTPAINT; case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: mode = GetBkMode(nmlvcd->nmcd.hdc); - todo_wine ok(mode == TRANSPARENT, "Got unexpected mode.\n"); clr = GetBkColor(nmlvcd->nmcd.hdc); if (showsel_always && is_selected)