DragList: Minor Bug Fix
Robert Shearman
rob at codeweavers.com
Fri Sep 10 15:06:25 CDT 2004
Hi,
This patch prevents a minor bug where on dragging for the second time
the cursor wouldn't be displayed properly. The uDragListMessage will be
properly sorted in a later patch, but it serves its purpose for the moment.
Rob
Changelog:
- Clear data structure after dragging.
- WM_SETCURSOR does not need to be handled as it is not sent whilst the
window is captured.
- Make uDragListMessage non-static so that we can re-use it elsewhere.
-------------- next part --------------
Index: wine/dlls/comctl32/draglist.c
===================================================================
RCS file: /home/wine/wine/dlls/comctl32/draglist.c,v
retrieving revision 1.19
diff -u -p -r1.19 draglist.c
--- wine/dlls/comctl32/draglist.c 11 Mar 2004 00:38:44 -0000 1.19
+++ wine/dlls/comctl32/draglist.c 10 Sep 2004 20:02:26 -0000
@@ -74,7 +74,7 @@ typedef struct _DRAGLISTDATA
RECT last_drag_icon_rect;
} DRAGLISTDATA;
-static UINT uDragListMessage = 0; /* registered window message code */
+UINT uDragListMessage = 0; /* registered window message code */
static DWORD dwLastScrollTime = 0;
static HICON hDragArrow = NULL;
@@ -99,9 +99,10 @@ static inline void DragList_EndDrag(HWND
{
KillTimer(hwnd, DRAGLIST_TIMERID);
ReleaseCapture();
- data->dragging = FALSE;
/* clear any drag insert icon present */
InvalidateRect(GetParent(hwnd), &data->last_drag_icon_rect, TRUE);
+ /* clear data for next use */
+ memset(data, 0, sizeof(*data));
}
/***********************************************************************
@@ -118,8 +119,6 @@ DragList_SubclassWindowProc(HWND hwnd, U
{
case WM_LBUTTONDOWN:
SetFocus(hwnd);
- data->cursor = NULL;
- SetRectEmpty(&data->last_drag_icon_rect);
data->dragging = DragList_Notify(hwnd, DL_BEGINDRAG);
if (data->dragging)
{
@@ -180,15 +179,6 @@ DragList_SubclassWindowProc(HWND hwnd, U
{
DragList_EndDrag(hwnd, data);
DragList_Notify(hwnd, DL_DROPPED);
- }
- break;
-
- case WM_SETCURSOR:
- /* if app has told us to set a cursor then do so */
- if (data->dragging && data->cursor)
- {
- SetCursor(data->cursor);
- return TRUE;
}
break;
More information about the wine-patches
mailing list