1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-10 23:58:06 -05:00

The dummy drag-list item wasn't being removed on a single-click or

double-click (DL_BEGINDRAG followed immediately by DL_DROPPED with
no intervening DL_DRAGGING). Fixed.

[originally from svn r1391]
This commit is contained in:
Simon Tatham 2001-11-21 22:16:04 +00:00
parent 15517300d8
commit 96d1f87e19

View File

@ -1024,20 +1024,20 @@ int handle_prefslist(struct prefslist *hdl,
SetWindowLong(hwnd, DWL_MSGRESULT, DL_STOPCURSOR);
ret = 1; break;
case DL_DROPPED:
ret = 1;
if (!hdl->dragging) break;
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, TRUE);
if (dest > hdl->dummyitem) dest = hdl->dummyitem;
DrawInsert (hwnd, dlm->hWnd, -1);
if (hdl->dragging) {
dest = pl_itemfrompt(dlm->hWnd, dlm->ptCursor, TRUE);
if (dest > hdl->dummyitem) dest = hdl->dummyitem;
DrawInsert (hwnd, dlm->hWnd, -1);
}
SendDlgItemMessage(hwnd, hdl->listid,
LB_DELETESTRING, hdl->dummyitem, 0);
hdl->dragging = 0;
if (dest >= 0) {
/* Correct for "missing" item. This means you can't drag
* an item to the end, but that seems to be the way this
* control is used. */
if (dest > hdl->srcitem) dest--;
pl_moveitem(hwnd, hdl->listid, hdl->srcitem, dest);
if (hdl->dragging) {
hdl->dragging = 0;
if (dest >= 0) {
/* Correct for "missing" item. */
if (dest > hdl->srcitem) dest--;
pl_moveitem(hwnd, hdl->listid, hdl->srcitem, dest);
}
}
ret = 1; break;
}