In various apps such as ActivityMonitor, BDraggers are instantiated with
invalid rects (in ActivityView's case in particular, (-7, -7, 0, 0)). BDragger would happily accept these, and preserve them when being archived/unarchived, which led to its position being completely messed up in the target shelf. We now compensate for this when determining our relationship with the target view. This fixes the problems with missing replicant handles in BSnow, ActivityMonitor and probably others replicants. The solution used here might not be ideal though, so comments welcome. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -593,6 +593,13 @@ BDragger::_DetermineRelationship()
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
if (fRelation == TARGET_IS_PARENT) {
|
||||
BRect bounds (Frame());
|
||||
if (bounds.left < 0 || bounds.top < 0)
|
||||
MoveTo(Parent()->Bounds().right - bounds.Width(),
|
||||
Parent()->Bounds().bottom - bounds.Height());
|
||||
}
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user