When trying to auto-place a pose, we need to short circuit if we're the

Desktop and the next available slot lies outside of the view bounds.
Otherwise we loop forever. Resolves ticket #5218.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39012 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2010-10-19 20:01:13 +00:00
parent 567ffaecb9
commit 1959f8502b

View File

@ -3358,6 +3358,14 @@ BPoseView::PlacePose(BPose *pose, BRect &viewBounds)
// check good location on the desktop
|| (checkValidLocation && !IsValidLocation(rect))) {
NextSlot(pose, rect, viewBounds);
// we've scanned the entire desktop without finding an available position,
// give up and simply place it towards the top left.
if (checkValidLocation && !rect.Intersects(viewBounds)) {
fHintLocation = PinToGrid(BPoint(0.0, 0.0), fGrid, fOffset);
pose->SetLocation(fHintLocation, this);
rect = pose->CalcRect(this);
break;
}
}
rect.InsetBy(3, 0);