summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-10 18:58:46 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-10 18:58:46 +0300
commitf2a434a0b4809d0445b72c36e1f20030d96d31ad (patch)
tree0cc90c89bb62b1930fffd22ebdc826e4225b09ba /plugins/Clist_modern/src
parent4b01c007469ad2ddf79b5aac141782fbf2edf73f (diff)
fixes #2895 (Clist_modern: various quirks with embedded clists, metacontacts & drag-n-drops)
Diffstat (limited to 'plugins/Clist_modern/src')
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp32
-rw-r--r--plugins/Clist_modern/src/version.h2
2 files changed, 13 insertions, 21 deletions
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 714ca0f799..d634744cd0 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -953,13 +953,15 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
}
ClcContact *contSour, *contDest;
+ cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
+ cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
+ if (contDest->type != CLCIT_INFO && contSour->type != CLCIT_INFO)
switch (target) {
case DROPTARGET_ONSELF:
break;
case DROPTARGET_ONCONTACT:
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
if (contSour->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) {
@@ -971,8 +973,6 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
break;
case DROPTARGET_ONMETACONTACT:
- cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) {
@@ -986,8 +986,6 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
break;
case DROPTARGET_ONSUBCONTACT:
- cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT && mir_strcmp(contSour->pce->szProto, META_PROTO)) {
@@ -1075,23 +1073,29 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
}
else if (hitcontact == nullptr)
ReleaseCapture();
+
KillTimer(hwnd, TIMERID_DRAGAUTOSCROLL);
if (dat->dragStage == (DRAGSTAGE_NOTMOVED | DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd, TIMERID_RENAME, GetDoubleClickTime(), nullptr);
else if ((dat->dragStage & DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE) {
wchar_t Wording[500];
- ClcContact *contDest, *contSour;
+
POINT pt = UNPACK_POINT(lParam);
int target = GetDropTargetInformation(hwnd, dat, pt);
+
+ ClcContact *contDest, *contSour;
+ cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
+ cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
+
+ if (contDest->type != CLCIT_INFO && contSour->type != CLCIT_INFO)
switch (target) {
case DROPTARGET_ONSELF:
break;
case DROPTARGET_ONCONTACT:
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
- cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
if (contSour->isChat() || contDest->isChat())
break;
+
if (contSour->type == CLCIT_CONTACT) {
MCONTACT hcontact = contSour->hContact;
if (mir_strcmp(contSour->pce->szProto, META_PROTO)) {
@@ -1126,8 +1130,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
break;
case DROPTARGET_ONMETACONTACT:
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
- cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT) {
@@ -1168,8 +1170,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
break;
case DROPTARGET_ONSUBCONTACT:
- cliGetRowByIndex(dat, dat->iDragItem, &contSour, nullptr);
- cliGetRowByIndex(dat, dat->selection, &contDest, nullptr);
if (contSour->isChat() || contDest->isChat())
break;
if (contSour->type == CLCIT_CONTACT) {
@@ -1203,10 +1203,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
}
break;
- case DROPTARGET_ONGROUP:
- corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- break;
-
case DROPTARGET_INSERTION:
ClcContact *contact, *destcontact;
ClcGroup *group, *destgroup;
@@ -1245,10 +1241,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
}
break;
- case DROPTARGET_OUTSIDE:
- corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- break;
-
default:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
break;
diff --git a/plugins/Clist_modern/src/version.h b/plugins/Clist_modern/src/version.h
index 04c33a3fbc..abea33c11d 100644
--- a/plugins/Clist_modern/src/version.h
+++ b/plugins/Clist_modern/src/version.h
@@ -1,7 +1,7 @@
#define __MAJOR_VERSION 0
#define __MINOR_VERSION 9
#define __RELEASE_NUM 1
-#define __BUILD_NUM 11
+#define __BUILD_NUM 12
#include <stdver.h>