comctl32/listview: Call default handler for WM_PAINT disabled by WM_SETREDRAW

Nikolay Sivov bunglehead at gmail.com
Mon Aug 31 23:35:15 CDT 2009


Fixes bug http://bugs.winehq.org/show_bug.cgi?id=19826

Changelog:
    - Call default handler for WM_PAINT disabled by WM_SETREDRAW

>From 9a9fb5a12af9792986e2bf2a7b46dc065c85912d Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Mon, 31 Aug 2009 23:13:50 +0400
Subject: Call default handler for WM_PAINT disabled by WM_SETREDRAW

---
 dlls/comctl32/listview.c       |    3 ++-
 dlls/comctl32/tests/listview.c |   11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 6cc46b7..0f61fa8 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -9784,7 +9784,8 @@ static inline LRESULT LISTVIEW_WMPaint(LISTVIEW_INFO *infoPtr, HDC hdc)
 {
     TRACE("(hdc=%p)\n", hdc);
 
-    if (!is_redrawing(infoPtr)) return 0;
+    if (!is_redrawing(infoPtr))
+        return DefWindowProcW (infoPtr->hwndSelf, WM_PAINT, (WPARAM)hdc, 0);
 
     return LISTVIEW_Paint(infoPtr, hdc);
 }
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 8c58b3e..9f99b6a 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -2770,6 +2770,7 @@ static void test_setredraw(void)
     DWORD_PTR style;
     DWORD ret;
     HDC hdc;
+    RECT rect;
 
     hwnd = create_listview_control(LVS_OWNERDATA);
     ok(hwnd != NULL, "failed to create a listview window\n");
@@ -2790,6 +2791,16 @@ static void test_setredraw(void)
     ret = SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
     expect(0, ret);
 
+    /* check update rect after redrawing */
+    ret = SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
+    expect(0, ret);
+    InvalidateRect(hwnd, NULL, FALSE);
+    RedrawWindow(hwnd, NULL, NULL, RDW_UPDATENOW);
+    rect.right = rect.bottom = 1;
+    GetUpdateRect(hwnd, &rect, FALSE);
+    expect(0, rect.right);
+    expect(0, rect.bottom);
+
     /* WM_ERASEBKGND */
     hdc = GetWindowDC(hwndparent);
     ret = SendMessage(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0);
-- 
1.5.6.5





More information about the wine-patches mailing list