_AddReplicant() now calls CanAcceptReplicantView(), too, which fixes the incorrect

replicant positioning upon add, a.k.a. bug #639: Deskbar relied on that method
being called to add positioning information to the replicant.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18354 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-08-02 20:47:27 +00:00
parent 772abce732
commit f1d0add2ca

View File

@ -1161,7 +1161,6 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
dragger->SetViewToDrag(replicant);
relation = BDragger::TARGET_IS_SIBLING;
}
} else {
// Replicant is child of the dragger
if ((dragger = dynamic_cast<BDragger*>(view)) != NULL) {
@ -1190,6 +1189,19 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
} else
frame = dragger->Frame().OffsetToCopy(point);
if (!CanAcceptReplicantView(frame, replicant, data)) {
// the view has not been accepted
if (relation == BDragger::TARGET_IS_PARENT
|| relation == BDragger::TARGET_IS_SIBLING)
delete replicant;
if (relation == BDragger::TARGET_IS_CHILD
|| relation == BDragger::TARGET_IS_SIBLING)
delete dragger;
return send_reply(data, B_ERROR, uniqueID);
}
BPoint adjust = AdjustReplicantBy(frame, data);
// TODO: that's probably not correct for all relations (or any?)
@ -1200,7 +1212,6 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
fContainerView->AddChild(dragger);
replicant->AddFilter(new _TReplicantViewFilter_(this, replicant));
} else if (fDisplayZombies && fAllowZombies) {
// TODO: the zombies must be adjusted and moved as well!
BRect frame;