Nikolay Sivov : comctl32/listview: Invalidate list after WM_MEASUREITEM notification.
Alexandre Julliard
julliard at winehq.org
Tue Jun 23 10:02:43 CDT 2009
Module: wine
Branch: master
Commit: ad7f0b950b75e37f8c1b05037238702dc082e3b5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ad7f0b950b75e37f8c1b05037238702dc082e3b5
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Mon Jun 22 22:38:03 2009 +0400
comctl32/listview: Invalidate list after WM_MEASUREITEM notification.
---
dlls/comctl32/listview.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 0e22848..ab94936 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -1027,7 +1027,8 @@ static inline DWORD notify_postpaint (const LISTVIEW_INFO *infoPtr, NMLVCUSTOMDR
return notify_customdraw(infoPtr, CDDS_POSTPAINT, lpnmlvcd);
}
-static void notify_measureitem(LISTVIEW_INFO *infoPtr)
+/* returns TRUE when repaint needed, FALSE otherwise */
+static BOOL notify_measureitem(LISTVIEW_INFO *infoPtr)
{
MEASUREITEMSTRUCT mis;
mis.CtlType = ODT_LISTVIEW;
@@ -1038,7 +1039,11 @@ static void notify_measureitem(LISTVIEW_INFO *infoPtr)
mis.itemHeight= infoPtr->nItemHeight;
SendMessageW(infoPtr->hwndNotify, WM_MEASUREITEM, mis.CtlID, (LPARAM)&mis);
if (infoPtr->nItemHeight != max(mis.itemHeight, 1))
+ {
infoPtr->nMeasureItemHeight = infoPtr->nItemHeight = max(mis.itemHeight, 1);
+ return TRUE;
+ }
+ return FALSE;
}
/******** Item iterator functions **********************************/
@@ -10792,7 +10797,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if ((infoPtr->dwStyle & LVS_OWNERDRAWFIXED) && (infoPtr->uView == LV_VIEW_DETAILS))
{
- notify_measureitem(infoPtr);
+ if (notify_measureitem(infoPtr)) LISTVIEW_InvalidateList(infoPtr);
}
LISTVIEW_UpdateSize(infoPtr);
More information about the wine-cvs
mailing list