Alex Henrie : comctl32/listview: Don' t invalidate when new style is same as old.

Alexandre Julliard julliard at winehq.org
Thu Sep 13 03:49:14 CDT 2018


Module: wine
Branch: stable
Commit: 670e492c095b133d0bcab0958c5ca6cdd3be2571
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=670e492c095b133d0bcab0958c5ca6cdd3be2571

Author: Alex Henrie <alexhenrie24 at gmail.com>
Date:   Sun May 13 21:56:12 2018 -0600

comctl32/listview: Don't invalidate when new style is same as old.

Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 8e9ea7a8a163147012908bad696a539454654d8f)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

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

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index c085578..1efc62c 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -11113,14 +11113,13 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
 static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
                                  const STYLESTRUCT *lpss)
 {
-    UINT uNewView = lpss->styleNew & LVS_TYPEMASK;
-    UINT uOldView = lpss->styleOld & LVS_TYPEMASK;
+    UINT uNewView, uOldView;
     UINT style;
 
     TRACE("(styletype=%lx, styleOld=0x%08x, styleNew=0x%08x)\n",
           wStyleType, lpss->styleOld, lpss->styleNew);
 
-    if (wStyleType != GWL_STYLE) return 0;
+    if (wStyleType != GWL_STYLE || lpss->styleNew == infoPtr->dwStyle) return 0;
 
     infoPtr->dwStyle = lpss->styleNew;
 
@@ -11132,6 +11131,9 @@ static INT LISTVIEW_StyleChanged(LISTVIEW_INFO *infoPtr, WPARAM wStyleType,
         ((lpss->styleNew & WS_VSCROLL) == 0))
        ShowScrollBar(infoPtr->hwndSelf, SB_VERT, FALSE);
 
+    uNewView = lpss->styleNew & LVS_TYPEMASK;
+    uOldView = lpss->styleOld & LVS_TYPEMASK;
+
     if (uNewView != uOldView)
     {
     	HIMAGELIST himl;
diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index 18e874a..f70e566 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -1750,6 +1750,7 @@ static void test_redraw(void)
     HDC hdc;
     BOOL res;
     DWORD r;
+    RECT rect;
 
     hwnd = create_listview_control(LVS_REPORT);
     subclass_header(hwnd);
@@ -1807,6 +1808,13 @@ static void test_redraw(void)
 
     ReleaseDC(hwndparent, hdc);
 
+    /* test setting the window style to what it already was */
+    UpdateWindow(hwnd);
+    SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE));
+    GetUpdateRect(hwnd, &rect, FALSE);
+    ok(rect.left == 0 && rect.top == 0 && rect.right == 0 && rect.bottom == 0,
+       "Expected empty update rect, got %s\n", wine_dbgstr_rect(&rect));
+
     DestroyWindow(hwnd);
 }
 




More information about the wine-cvs mailing list