From f1d0add2ca867809f4f9785cf16a8c47179a48cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 2 Aug 2006 20:47:27 +0000 Subject: [PATCH] _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 --- src/kits/interface/Shelf.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Shelf.cpp b/src/kits/interface/Shelf.cpp index c1a7539a7e..1e5292b424 100644 --- a/src/kits/interface/Shelf.cpp +++ b/src/kits/interface/Shelf.cpp @@ -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(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;