From 1daf40a8375fb134e8db6fb22bd5e92fe9ce84a3 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 1 Jul 2009 01:33:29 +0400 Subject: [PATCH] comctl32/header: Always release item down state on WM_LBUTTONUP. --- dlls/comctl32/header.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 1486a8ae36d..ddc9cb01fb3 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);