comctl32/listview: Block redrawing entirely after WM_SETREDRAW wParam=FALSE (try2)
Nikolay Sivov
bunglehead at gmail.com
Wed Aug 12 16:41:09 CDT 2009
Changelog:
- try2: use separate handler for WM_PAINT to move condition outside LISTVIEW_Paint()
- Block redrawing entirely after WM_SETREDRAW wParam=FALSE
>From fa34fdfab6522e895fc82dc5644a444ad21e190e Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Thu, 13 Aug 2009 01:38:08 +0400
Subject: Block redrawing entirely after WM_SETREDRAW wParam=FALSE
---
dlls/comctl32/listview.c | 23 +++++++++++++++++++++--
dlls/comctl32/tests/listview.c | 4 ++--
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index a65d832..36e7b7e 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9727,7 +9727,7 @@ static LRESULT LISTVIEW_NotifyFormat(LISTVIEW_INFO *infoPtr, HWND hwndFrom, INT
/***
* DESCRIPTION:
- * Paints/Repaints the listview control.
+ * Paints/Repaints the listview control. Internal use.
*
* PARAMETER(S):
* [I] infoPtr : valid pointer to the listview structure
@@ -9766,6 +9766,25 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
return 0;
}
+/***
+ * DESCRIPTION:
+ * Paints/Repaints the listview control, WM_PAINT handler.
+ *
+ * PARAMETER(S):
+ * [I] infoPtr : valid pointer to the listview structure
+ * [I] hdc : device context handle
+ *
+ * RETURN:
+ * Zero
+ */
+static inline LRESULT LISTVIEW_WMPaint(LISTVIEW_INFO *infoPtr, HDC hdc)
+{
+ TRACE("(hdc=%p)\n", hdc);
+
+ if (!is_redrawing(infoPtr)) return 0;
+
+ return LISTVIEW_Paint(infoPtr, hdc);
+}
/***
* DESCRIPTION:
@@ -10802,7 +10821,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return LISTVIEW_PrintClient(infoPtr, (HDC)wParam, (DWORD)lParam);
case WM_PAINT:
- return LISTVIEW_Paint(infoPtr, (HDC)wParam);
+ return LISTVIEW_WMPaint(infoPtr, (HDC)wParam);
case WM_RBUTTONDBLCLK:
return LISTVIEW_RButtonDblClk(infoPtr, (WORD)wParam, (SHORT)LOWORD(lParam), (SHORT)HIWORD(lParam));
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 516445c..fb90196 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2834,7 +2834,7 @@ static void test_setredraw(void)
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
- "redraw after WM_SETREDRAW (FALSE)", TRUE);
+ "redraw after WM_SETREDRAW (FALSE)", FALSE);
ret = SendMessage(hwnd, LVM_SETBKCOLOR, 0, CLR_NONE);
expect(TRUE, ret);
@@ -2842,7 +2842,7 @@ static void test_setredraw(void)
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq,
- "redraw after WM_SETREDRAW (FALSE) with CLR_NONE bkgnd", TRUE);
+ "redraw after WM_SETREDRAW (FALSE) with CLR_NONE bkgnd", FALSE);
/* message isn't forwarded to header */
subclass_header(hwnd);
--
1.5.6.5
More information about the wine-patches
mailing list