* Revert r42223 since it breaks some cases.
* Simplify handling a bit. Instead of more or less duplicating some of the move logic from PoseView, simply construct an appropriate target model and let PoseView's HandleDropCommon() take care of understanding what to do with the drag message. This has the side effect that things like dropping a text clipping message onto a target in an x-ray menu actually works as expected now. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42235 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1570,6 +1570,7 @@ BContainerWindow::MessageReceived(BMessage *message)
|
|||||||
//
|
//
|
||||||
entry_ref ref;
|
entry_ref ref;
|
||||||
if (message->FindRef("refs", &ref) == B_OK) {
|
if (message->FindRef("refs", &ref) == B_OK) {
|
||||||
|
|
||||||
//printf("BContainerWindow::MessageReceived - refs received\n");
|
//printf("BContainerWindow::MessageReceived - refs received\n");
|
||||||
fWaitingForRefs = false;
|
fWaitingForRefs = false;
|
||||||
BEntry entry(&ref, true);
|
BEntry entry(&ref, true);
|
||||||
@@ -1577,37 +1578,12 @@ BContainerWindow::MessageReceived(BMessage *message)
|
|||||||
// don't copy to printers dir
|
// don't copy to printers dir
|
||||||
if (!FSIsPrintersDir(&entry)) {
|
if (!FSIsPrintersDir(&entry)) {
|
||||||
if (entry.InitCheck() == B_OK && entry.IsDirectory()) {
|
if (entry.InitCheck() == B_OK && entry.IsDirectory()) {
|
||||||
uint32 moveMode = kMoveSelectionTo;
|
|
||||||
int32 buttons = fDragMessage->FindInt32("buttons");
|
|
||||||
if (buttons & B_SECONDARY_MOUSE_BUTTON || modifiers() & B_CONTROL_KEY) {
|
|
||||||
BPoint dropPoint;
|
|
||||||
PoseView()->GetMouse(&dropPoint, NULL, true);
|
|
||||||
moveMode = ShowDropContextMenu(dropPoint);
|
|
||||||
if (moveMode == kCancelButton)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// build of list of entry_refs from the list
|
|
||||||
// in the drag message
|
|
||||||
entry_ref dragref;
|
|
||||||
int32 index = 0;
|
|
||||||
BObjectList<entry_ref> *list = new BObjectList<entry_ref>(0, true);
|
|
||||||
while (fDragMessage->FindRef("refs", index++, &dragref) == B_OK)
|
|
||||||
list->AddItem(new entry_ref(dragref));
|
|
||||||
//
|
|
||||||
// compare the target and one of the drag items' parent
|
|
||||||
//
|
|
||||||
Model targetModel(&entry, true, false);
|
Model targetModel(&entry, true, false);
|
||||||
if (!CheckDevicesEqual(list->ItemAt(0), &targetModel))
|
BPoint dropPoint;
|
||||||
moveMode = kCopySelectionTo;
|
uint32 buttons;
|
||||||
// copy drag contents to target ref in message
|
PoseView()->GetMouse(&dropPoint, &buttons, true);
|
||||||
FSMoveToFolder(list, new BEntry(entry),
|
PoseView()->HandleDropCommon(fDragMessage, &targetModel, NULL,
|
||||||
moveMode);
|
PoseView(), dropPoint);
|
||||||
targetModel.CloseNode();
|
|
||||||
} else {
|
|
||||||
// current message sent to apps is only B_REFS_RECEIVED
|
|
||||||
fDragMessage->what = B_REFS_RECEIVED;
|
|
||||||
FSLaunchItem(&ref, (const BMessage *)fDragMessage, true, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6716,6 +6716,8 @@ BPoseView::MouseMoved(BPoint mouseLoc, uint32 moveCode, const BMessage *message)
|
|||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
window->DragStart(message);
|
||||||
|
|
||||||
switch (moveCode) {
|
switch (moveCode) {
|
||||||
case B_INSIDE_VIEW:
|
case B_INSIDE_VIEW:
|
||||||
case B_ENTERED_VIEW:
|
case B_ENTERED_VIEW:
|
||||||
@@ -7022,10 +7024,6 @@ BPoseView::DragSelectedPoses(const BPose *pose, BPoint clickPoint)
|
|||||||
} else
|
} else
|
||||||
DragMessage(&message, dragRect);
|
DragMessage(&message, dragRect);
|
||||||
|
|
||||||
BContainerWindow* window = ContainerWindow();
|
|
||||||
if (window != NULL)
|
|
||||||
window->DragStart(&message);
|
|
||||||
|
|
||||||
// turn on auto scrolling
|
// turn on auto scrolling
|
||||||
fAutoScrollState = kWaitForTransition;
|
fAutoScrollState = kWaitForTransition;
|
||||||
Window()->SetPulseRate(100000);
|
Window()->SetPulseRate(100000);
|
||||||
|
|||||||
Reference in New Issue
Block a user