Nikolay Sivov : comctl32/header: Always release item down state on WM_LBUTTONUP.

Alexandre Julliard julliard at winehq.org
Wed Jul 1 09:28:11 CDT 2009


Module: wine
Branch: master
Commit: 1daf40a8375fb134e8db6fb22bd5e92fe9ce84a3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1daf40a8375fb134e8db6fb22bd5e92fe9ce84a3

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Wed Jul  1 01:33:29 2009 +0400

comctl32/header: Always release item down state on WM_LBUTTONUP.

---

 dlls/comctl32/header.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c
index 1486a8a..ddc9cb0 100644
--- a/dlls/comctl32/header.c
+++ b/dlls/comctl32/header.c
@@ -1590,6 +1590,9 @@ HEADER_LButtonUp (HEADER_INFO *infoPtr, INT x, INT y)
     HEADER_InternalHitTest (infoPtr, &pt, &flags, &nItem);
 
     if (infoPtr->bPressed) {
+
+	infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
+
 	if (infoPtr->bDragging)
 	{
             HEADER_ITEM *lpItem = &infoPtr->items[infoPtr->iMoveItem];
@@ -1597,8 +1600,7 @@ HEADER_LButtonUp (HEADER_INFO *infoPtr, INT x, INT y)
             
 	    ImageList_DragShowNolock(FALSE);
 	    ImageList_EndDrag();
-            lpItem->bDown=FALSE;
-            
+
             if (infoPtr->iHotDivider == -1)
                 iNewOrder = -1;
             else if (infoPtr->iHotDivider == infoPtr->uNumItem)
@@ -1623,14 +1625,14 @@ HEADER_LButtonUp (HEADER_INFO *infoPtr, INT x, INT y)
             infoPtr->bDragging = FALSE;
             HEADER_SetHotDivider(infoPtr, FALSE, -1);
 	}
-	else if (!(infoPtr->dwStyle & HDS_DRAGDROP) || !HEADER_IsDragDistance(infoPtr, &pt))
+	else
 	{
-	    infoPtr->items[infoPtr->iMoveItem].bDown = FALSE;
 	    hdc = GetDC (infoPtr->hwndSelf);
 	    HEADER_RefreshItem (infoPtr, infoPtr->iMoveItem);
 	    ReleaseDC (infoPtr->hwndSelf, hdc);
 
-	    HEADER_SendNotifyWithHDItemT(infoPtr, HDN_ITEMCLICKW, infoPtr->iMoveItem, NULL);
+	    if (!(infoPtr->dwStyle & HDS_DRAGDROP) || !HEADER_IsDragDistance(infoPtr, &pt))
+		HEADER_SendNotifyWithHDItemT(infoPtr, HDN_ITEMCLICKW, infoPtr->iMoveItem, NULL);
 	}
 
 	TRACE("Released item %d!\n", infoPtr->iMoveItem);




More information about the wine-cvs mailing list