_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:
@@ -1161,7 +1161,6 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
|
|||||||
dragger->SetViewToDrag(replicant);
|
dragger->SetViewToDrag(replicant);
|
||||||
relation = BDragger::TARGET_IS_SIBLING;
|
relation = BDragger::TARGET_IS_SIBLING;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Replicant is child of the dragger
|
// Replicant is child of the dragger
|
||||||
if ((dragger = dynamic_cast<BDragger*>(view)) != NULL) {
|
if ((dragger = dynamic_cast<BDragger*>(view)) != NULL) {
|
||||||
@@ -1190,6 +1189,19 @@ BShelf::_AddReplicant(BMessage *data, BPoint *location, uint32 uniqueID)
|
|||||||
} else
|
} else
|
||||||
frame = dragger->Frame().OffsetToCopy(point);
|
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);
|
BPoint adjust = AdjustReplicantBy(frame, data);
|
||||||
|
|
||||||
// TODO: that's probably not correct for all relations (or any?)
|
// 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);
|
fContainerView->AddChild(dragger);
|
||||||
|
|
||||||
replicant->AddFilter(new _TReplicantViewFilter_(this, replicant));
|
replicant->AddFilter(new _TReplicantViewFilter_(this, replicant));
|
||||||
|
|
||||||
} else if (fDisplayZombies && fAllowZombies) {
|
} else if (fDisplayZombies && fAllowZombies) {
|
||||||
// TODO: the zombies must be adjusted and moved as well!
|
// TODO: the zombies must be adjusted and moved as well!
|
||||||
BRect frame;
|
BRect frame;
|
||||||
|
|||||||
Reference in New Issue
Block a user