Lei Zhang : comctl32: Handle listview dragging better.
Alexandre Julliard
julliard at winehq.org
Thu Sep 11 08:01:04 CDT 2008
Module: wine
Branch: master
Commit: fc2404bc206b07f7ffe6e980a026d1badf9d1376
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fc2404bc206b07f7ffe6e980a026d1badf9d1376
Author: Lei Zhang <thestig at google.com>
Date: Wed Sep 10 16:45:13 2008 -0700
comctl32: Handle listview dragging better.
---
dlls/comctl32/listview.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c
index ba53434..1627001 100644
--- a/dlls/comctl32/listview.c
+++ b/dlls/comctl32/listview.c
@@ -257,6 +257,7 @@ typedef struct tagLISTVIEW_INFO
HIMAGELIST himlState;
BOOL bLButtonDown;
BOOL bRButtonDown;
+ BOOL bDragging;
POINT ptClickPos; /* point where the user clicked */
BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */
INT nItemHeight;
@@ -3344,7 +3345,11 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
nmlv.iItem = lvHitTestInfo.iItem;
nmlv.ptAction = infoPtr->ptClickPos;
- notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
+ if (!infoPtr->bDragging)
+ {
+ notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
+ infoPtr->bDragging = TRUE;
+ }
return 0;
}
@@ -8605,6 +8610,7 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
/* set left button down flag and record the click position */
infoPtr->bLButtonDown = TRUE;
infoPtr->ptClickPos = pt;
+ infoPtr->bDragging = FALSE;
lvHitTestInfo.pt.x = x;
lvHitTestInfo.pt.y = y;
@@ -8716,6 +8722,12 @@ static LRESULT LISTVIEW_LButtonUp(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, INT
/* set left button flag */
infoPtr->bLButtonDown = FALSE;
+ if (infoPtr->bDragging)
+ {
+ infoPtr->bDragging = FALSE;
+ return 0;
+ }
+
/* if we clicked on a selected item, edit the label */
if(lvHitTestInfo.iItem == infoPtr->nEditLabelItem && (lvHitTestInfo.flags & LVHT_ONITEMLABEL))
{
More information about the wine-cvs
mailing list