Nikolay Sivov : comctl32/listview: Take care of scrolling offset when repositioning header.

Alexandre Julliard julliard at winehq.org
Wed May 15 14:32:20 CDT 2019


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Feb  9 23:23:40 2019 +0300

comctl32/listview: Take care of scrolling offset when repositioning header.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 5b397df63147ec83a929ba997b395687e6c4c10d)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/comctl32/listview.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index 1230c55..078bea1 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -11084,13 +11084,21 @@ static void LISTVIEW_UpdateSize(LISTVIEW_INFO *infoPtr)
         infoPtr->rcList.bottom = max (infoPtr->rcList.bottom - 2, 0);
     }
 
-    /* if control created invisible header isn't created */
+    /* When ListView control is created invisible, header isn't created right away. */
     if (infoPtr->hwndHeader)
     {
-	HDLAYOUT hl;
-	WINDOWPOS wp;
+        POINT origin;
+        WINDOWPOS wp;
+        HDLAYOUT hl;
+        RECT rect;
 
-	hl.prc = &infoPtr->rcList;
+        LISTVIEW_GetOrigin(infoPtr, &origin);
+
+        rect = infoPtr->rcList;
+        rect.left += origin.x;
+        rect.top += origin.y;
+
+        hl.prc = ▭
 	hl.pwpos = ℘
 	SendMessageW( infoPtr->hwndHeader, HDM_LAYOUT, 0, (LPARAM)&hl );
 	TRACE("  wp.flags=0x%08x, wp=%d,%d (%dx%d)\n", wp.flags, wp.x, wp.y, wp.cx, wp.cy);




More information about the wine-cvs mailing list