# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1318155861 0 # Node ID e16e7c51b6c74446be386b1a284264939f10607a # Parent 22cedf18db25625b94ce5e1cbd029534b86dfdad Another attempt at fixing alternating row issues on Windows. diff -r 22cedf18db25 -r e16e7c51b6c7 win/dw.c --- a/win/dw.c Sun Oct 09 10:13:16 2011 +0000 +++ b/win/dw.c Sun Oct 09 10:24:21 2011 +0000 @@ -2711,19 +2711,15 @@ GetUpdateRect(hWnd, &rectUpd, FALSE); /* allow default processing first */ CallWindowProc(cinfo->cinfo.pOldProc, hWnd, msg, 0, 0); - /* set the row horizontal dimensions */ - SetRect(&rect, rectUpd.left, 0, rectUpd.right, 0); /* number of displayed rows */ iItems = ListView_GetCountPerPage(hWnd); /* first visible row */ iTop = ListView_GetTopIndex(hWnd); - for(i=iTop; i<=iTop+iItems; i++) + for(i=iTop; i<=(iTop+iItems+1); i++) { - /* Get the row's rect */ - ListView_GetItemRect(hWnd, i, &rect, LVIR_BOUNDS); /* if row rectangle intersects update rectangle then it requires re-drawing */ - if(IntersectRect(&rectDestin, &rectUpd, &rect)) + if(ListView_GetItemRect(hWnd, i, &rect, LVIR_BOUNDS) && IntersectRect(&rectDestin, &rectUpd, &rect)) { /* change text background colour accordingly */ c = (i % 2) ? cinfo->odd : cinfo->even; @@ -2732,7 +2728,7 @@ { ListView_SetTextBkColor(hWnd, c); /* invalidate the row rectangle then... */ - InvalidateRect(hWnd, &rect, FALSE); + InvalidateRect(hWnd, &rectDestin, FALSE); /* ...force default processing */ CallWindowProc(cinfo->cinfo.pOldProc, hWnd, msg, 0, 0); }